Here's a thought: If you live in a country where people are summarily executed for being gay, don't put "I'm gay" on a public website with your name on it.
YES people should be allowed to be gay in Tehran, and YES Facebook should help them with that - and they do: By not requiring you to enter your sexuality.
I don't live in Tehran, so I am privileged here - but if I put "I did tax fraud, I win!" on my public Facebook profile, and the tax authorities decided to investigate me, anyone suggesting that I didn't bring that upon myself, frankly required supervision. Even if I did it on my closed Facebook profile and a "friend" decided to report me, it's still not Facebook's fault.
> It strikes me that you are of the belief that cyberspace ought to mimic life in meatspace directly.
If it's a problem that Facebook uncovers someone who's gay in Tehran, then that is only because that persons cyberspace identity mimics his meatspace one. If the gay person in Tehran profile doesn't actually link up to a physical person in Tehran, then there's no added danger to anyone.