>Röhm's appointment was opposed from the beginning by some in the SA who saw it as cementing the subordination of the SA to the Nazi Party's political wing. His homosexuality was seized upon by those who disagreed with the organizational reforms but could not openly criticize Hitler without breaking with Nazism, because of the Führer principle. Hitler said that the personal life of a Nazi was only a concern for the party if it contradicted the fundamental principles of Nazism. The leader of the Berlin SA, Walther Stennes, rebelled against the SA leadership and declared that he and his followers would "never serve under a notorious homosexual like Röhm and his Pupenjungen (male prostitutes)". On 3 February, Hitler dismissed Stennes's objection, stating, "The SA is not a girls' boarding school."
In case it is not obvious from my original comment, I am not trying to paint Nazi party as a beacon of DEI. The Nazi state went on to murder thousands of homosexuals. But in response to the OP, Röhm was certainly not closeted and it is doubtful that his homosexuality could even be described as an 'open secret'.
It's reasonably simple: Be sufficiently powerful and your sins will be overlooked (for a recent example: See Donald Trump's "sentence" in New York). And in non-rule-of-law societies your sins-while-powerful will be used against you (this is why democracies historically always had immunity arrangements)