R
It's not out of context. It is a comparison. And the angels who sinned are being compared in their sin to the people of Sodom and Gomorroah who were not only gay but tried to sleep with angels.
they are three -unrelated- examples of the wicked being judged
and actually the sins committed in all three cases are identified in verse eight...the section is organized into chiastic form like this...
A...verse five...the sin of the israelite unbelievers after they left egypt
B...verse six...the fallen angels
C...verse seven...the sexual immorality of the sodomites
C'...verse eight...polluting their own bodies...the sin of the sodomites in verse seven
B'...verse eight...rejecting authority...the sin of the fallen angels in verse six
A'...verse eight...slandering celestial beings...the sin of the israelite unbelievers in verse five
so the sin of the fallen angels was actually the rejection of God's authority...not sexual immorality...