I don't really know how dumb Gaetz is. He gives me dumb guy vibes, for sure, but he has a law degree. On one end of the spectrum, the Ethics report was about to be released and he knows what is in it and knows it is true and I guess it might trigger a criminal investigation. Resigning made the report officially irrelevant. If he had resigned ignominiously they might have released it anyway and it would definitely make him look guilty in any case. But since he was up for a Cabinet post, Mike Johnson went to bat for him and kept it sealed. If he is very smart, he maneuvered a way to keep his secrets sort of secret and can tell a lot of Republicans that it was a witch hunt.
But on the low end, given that he reportedly took two prostitutes to see "Pretty Woman the Musical", he may have believed he was getting a recess appointment.