Why is camping considered bad gameplay?
Put simply, camping isn't fun to play against.
Camping is a fairly simple, effective strategy when the game allows such a mechanic. It doesn't necessarily require a lot of skill to put a lot of pain on the other team when camping. People get frustrated and hurl insults when they're losing, especially to such a tactic that requires "so little skill" to pull off.
Another argument is that camping isn't fun to do, either, although this one is a bit flawed. Camping certainly is fun when it nets your team the win, because winning is fun. A better way to phrase it is that camping shouldn't be what's fun, because in theory the game should have more rewarding gameplay elsewhere. Direct engagement should be the most fun thing in a game, according to these people, and if you're camping you're "doing it wrong".
Snipers kind of have to camp; that's the basic gameplay of the class. It's frustrating to play against, so people rage out about it. Generally, though, even the best sniper can be taken out with just a little teamwork. Camping is a strategy, and like any strategy in a game, there are countermeasures that can be taken against it.
Camping is generally considered bad if there is little to no opposition you can form against said camper. There are several different cases, I can give you examples:
Spawn-Camping: Spawn-Camping is bad because usually, shortly after respawning, an opponent is still unprepared for combat. You spawn at a sometimes random location, you need to get your bearings, you take a couple of seconds to get your self familiarized, and before you are done, you are already dead.
Camping Snipers: This can be bad if there is no way for you to know where the shot came from. If you know where he is, it might still be difficult to oppose him if he has superior positioning. Some teammates might even protect a good sniper so he can't be flanked easily.
Camping areas: A lot of shooters have important areas that can be camped. This might or might not be part of the initial game design.
Now, you have two ways to look at it: Is it part of game design, or isn't it. Usually, spawn-Camping is looked down upon. However, in certain games and in situation in said games, it might be necessary. Case in point would be Team Fortress 2, where you push onto a last control point, and you are so close to the opponents spawn that you can just cut it out. In such a situation, spawn camping is necessary to win, however it might not even be considered camping.
In modern games where sniping is a core gameplay element, designers usually built in ways to counteract a sniper. These include killcams, scope reflection (seeing scoped in snipers), bullet trails, and more.
In general, if camping is not a necessity or part of the core gameplay, a lot of people look down on it because it is difficult to oppose campers that have superior positioning. Mostly, people are called campers because 1) they pick a class that has camping abilities, and 2) they are actually good enough so they can pin down a lot of people by utilizing said class. Usually, you won't call bad people campers because even if they have long range classes, they won't hit with it.