It was probably a good way to up the butch factor of the lead male by introducing those kind of jokes, to show how masculine he was by contrast or something. Or maybe it had to do with the old chestnut about being so secure in your masculinity that you can dare to do something that outrageous. Part of what I think you were getting at is that it's often the most "manly" ones doing it, so there's the huge surprise factor and therefore a bigger comic payoff. Today, the "joke" is more likely to be lost on us, especially if any real offense is given. It's a good example of how films really are a mirror of their times. Unfortunately, gay-baiting in that way is not a lost art; you still see it today, sometimes with a little more restraint, sometimes not.
It's also possible some of it was a wink-wink kind of way for gay writers/directors/actors to telegraph to segments of the audience something only they would really get, the real intent behind the joke, sort of an earlier-day version of "We're here; we're ****; get used to it."
There are classic movies which weren't shown for years (and some still aren't) because the racial stereotyping is considered too extreme and can only be read as insensitivity by a modern audience. That hasn't really happened in terms of gay stereotyping and I'm not recommending that it should, that such movies should be withheld, but we need to acknowledge that these old films still have the power to sway minds and influence attitudes. The example you gave of Right Cross seems harmless enough. I know this topic is just a point of interest with you and it's not your intention to raise any kind of alarm and I don't think being too thin-skinned would get gay people anywhere in particular anyway, but it's helpful to talk about these things rather than just shrug them off. Good topic.