No, it originated in the medical/scientific field. When trying to evaluate, say, the epidemiology of AIDS in the "gay" community, they realized that there were a lot of men who would deny being gay even in a confidential survey, but still had sex with other men and
would admit that
in the same survey. To be crude, they would often have these exchanges: "When's the last time you sucked a guy's dick?" "Last week." "Are you gay or bi?" "No." Which makes a lot of your study's results useless if you're keying on the second question rather than the first.
Plus, you know, bi men make "gay" a bad term if what you're studying is the phenomenon of men having sex with men.
So, they started using a category "men who have sex with men" instead of "gay men", and classified study subjects into those categories based on questions about specific behaviors rather than about identity.
It's not a label invented by the people to whom it applies, and doesn't have much to do with politicization or activism (though of course MSM who don't identify as gay or bi are less likely to be politically active on LGBTQ rights issues, but many gay-identifying men also aren't politically active).