It's all very well to say "there is the law to protect them", "we don't need to know", "heterosexuals never announce it", etc.
The first thing that has to be recognized is that heterosexuality is taken to be the "norm". People don't have to "announce" it because it is taken to be the "default". The other thing, of course, is that there is no big deal to it: there is nobody who, out of fear, has to hide the fact that he or she is heterosexual.
Second, point to the law and so on is unhelpful, because we all know that there is a great deal of discrimination against gays and that some of it can get very nasty, law or no law.
Third, in most places, even where nominally accepted, gays are not permitted certain things that heterosexuals take as a "right"---for example, public displays of affection.
The reasons why they "come out" or "announce it" are actually quite straightforward. One is that "living a lie" or hiding ones true self inevitably has a high psychological cost. At some point many take the wiser option. The second, and very important reason, is to offer moral support to others of their orientation, especially those who still feel that they must hide who they really are. I do not have the slightest doubt that many homosexuals have found some "comfort" in Cook's announcement.
In regard to the last point, it is enlightening to consider the early history of Christianity, especially in the Roman Empire. It was a tough life and in many ways not dissimilar to the situation with gays. "Coming out" as a Christian was a very risk thing; but people would do it, and other Christians "in the closest" claimed to find it supportive when others "came out", especially if it was a "big person".