Yeah, for some future employers it may seem unprofessional, but I would not want to work for such employers.
On the contrary, I would recommend to consult a lawyer, sue them, write a blog about your case and a company, start a movement in the interests of depressed programmers and involve tech media in all of that. This will have both positive externalities and benefits for OP: more protection for depresssed programmers, less incentives for unethical companies to behave like that, traffic for the OP new blog and possibly several job opportunities.
OP, I consider naming and shaming unethical companies like this to be a preferred course of action if done strategically.
Yeah, sometimes, when organizations are locked into Nash equilibrium and any individual actor can't change rules of the game, in that case naming and shaming is unproductive.
Firing a person who has written about their depression? No excuse. Don't give them a chanche to protect themselves(WTF?!). Destroy the company. Help others like you.
EDIT OP, I see you deleted the comments with the name of the company. Please don't let it slide. Fight for yourself and for others who are suffering from depression and are being discriminated against.