In reality the counter to them is splash damage, though good micro can mitigate that somewhat, & Terran isn't going to stop building marines just because the opponent built some splash damage
In some regards this can be rooted in people expecting StarCraft to be like Age of Empires, where as you climb the tech tree you discard previous tech. StarCraft instead prefers tech to fill out a composition & late tech often provides a support role to earlier tech
https://tl.net/forum/starcraft-2/174912-the-problem-with-mar... (2010)
In Star Craft, each unit has opposing units that are extra effective against it, so if your opponent had a bunch of marines, you might build a bunch of siege tanks.
Here's a whole article on counters to the marine unit: https://osirissc2guide.com/marine-counter.html
I think it's a funny joke, though. Even though, when I've played Stacraft, I've been the one making marines.