Actually, surprisingly, Luther did think this and did make this accusation. Luther made John the Baptist's accusation against Herod's adultery seem trivial compared to the corruption of the Roman clergy. Clearly he accused the Roman clergy of practicing sodomy:
I am not lying to you. Whoever has been in Rome knows that conditions are unfortunately worse there than anyone can say or believe. When the last Lateran council was to be concluded in Rome under Pope Leo, among other articles it was decreed that one must believe the soul to be immortal. From this one may gather that they make eternal life an object of sheer mockery and contempt. In this way they confess that it is a common belief among them that there is no eternal life, but that they now wish to proclaim this by means of a bull. More remarkable yet, in the same bull they decided that a cardinal should not keep as many boys in the future. However, Pope Leo commanded that this be deleted; otherwise it would have been spread throughout the whole world how openly and shamelessly the pope and the cardinals in Rome practice sodomy. I do not wish to mention the pope, but since the knaves will not repent, but condemn the gospel, blaspheme and revile God’s word, and excuse their vices, they, in turn, will have to take a whiff of their own terrible filth. This vice is so prevalent among them that recently a pope caused his own death by means of this sin and vice.In fact, he died on the spot. All right now, you popes, cardinals, papists, spiritual lords, keep on persecuting God’s word and defending your doctrine and your churches!
No pope, cardinal, bishop, doctor, priest, monk, or nun will condemn such an obviously disgraceful life; rather they laugh about it, excuse it, and gloss over it. They incite kings, princes, country, and people to defend such knaves with life and property, with land and people, and faithfully to protect them so that such vices might not be repented of and reformed, but rather strengthened, sanctioned, and approved. Now you are to hazard blood, body, and life just for the sake of Saddling your neck and conscience with this. I could easily mention more examples of such abominations, but it is too shameful; I fear that our German soil would have to tremble before it. But if an impudent popish ass should come along and dispute this, he will find me ready to do him battle, and it will be quite a battle! (Luther's Works Volume 47, P38)
It appears that he thought this practice was related to the forced abstinence that the priests and Pope had to bear:
There Is Danger in Avoiding Marriage May 29, 1539
Thereupon there was conversation about the delightful institution of marriage. [Martin Luther said,] “Through the papists Satan so defiled it that in his little book on the celibacy of priests Cyprian wrote, ‘If you hear a woman speak, flee from her as if she were a hissing snake.’ That’s the way it is. When one is afraid of whores one must fall into Sodomite depravity, as almost happened to St. Jerome. ( Luther's Works Volume 54, P357)