Illegal To Be Gay?

Not likely, but it does seem like the man was seriously sexually repressed.

(a) without proof that a single person was ever punished in the legal system in the U.S. during that time period for merely having and expressing a same-sex preference – this doesn’t add much.
(b) “Under Hoover’s heel?” Putting aside the pejorative, were you under the impression that most if any laws/policies on vice/morals were formulated at the federal level? They weren’t, ever.
(c) Hoover’s agenda didn’t have much to do with squelching immoral behavior. His obsessions were things like communism and the Black Panthers. AFAICT, the FBI’s main involvement with matters relating to personal conduct was to collect information that could be used to discredit or blackmail members of groups that were deemed subversive or undesirable for other reasons – this could include any flavor of sexual peccadillo, certainly, but I doubt he’d have been any much less or more interested in catching MLK in a homosexual liaison than a straight one (that is, he’d have been very interested in either).
(d) “it is thought” and “probably” overstate the case on Hoover’s sexual preference. Both the column here and the Wiki article (okay, fine, but it’s some sort of consensus) are explicit in saying there is no concrete proof JEH and Tolson were lovers, and Wiki points out some facts that may steer away from that conclusion.