I guess it's more politically correct to portray sexually amoral people than a perceived moron. At least, I thought Gomer was a moron after watching this show as a kid. However, what he really is is a fish out of water. A country bumpkin surrounded by people who don't get him. Actually, the Gomer character evolved from Andy Griffith, where he was more of the town idiot. In Gomer Pyle, USMC, Gomer takes the moral high ground. He represents all that is good about small town America, even as his fellow Marines (or locals he meets) look to cheat their way through life.
I binge-watched these shows after Jim Nabors's recent death, and I saw actual wholesome laughs that came not from Gomer being stupid, but from him being honest to a fault. Rather than being the clown, like he was in Mayberry, he's the Everyman in this show. He's who we SHOULD want to be. But we also see the bullying and head shaking directed his way. And we also see that it's often dumb luck that allows Gomer to prevail, since many of the plots are too easily solved by his innocent honesty. Is he as role model? I'm not sure, but he's a good person in the show, and that's actually fairly rare in sitcoms.