There are some laws that are clearly 'terribly vindictive', but I think the main problem that selective enforcement is aimed at helping with are overly broad laws. You may say then that those laws shouldn't be overly broad, and that is a good theory, but it has a major flaw in practice. Laws are often deliberately written to be somewhat broad because the lawmakers know they cannot identify all the edge cases, or when technology changes, and they don't like it when a person clearly violates what a law was meant to make illegal but the letter of the law didn't foresee that exact situation. Either the laws are written strictly, in which case people commit crimes and get away with it because technically the law didn't make it illegal, or they are written broadly with the result that people perform actions that are technically illegal, but officers or prosecutors know were not the intent of the law and don't enforce. The flip side is of course that it gives power to the officials to charge people with crimes for what seem to be non-crimes (this is where courts and juries can come in).
Take two examples from California. In one, the laws tried to be strict and explicitly listed what substances (drugs) were illegal. The result was criminals took the base drugs, made a small tweak to them, and presto, it was legally a new drug that the law didn't make illegal, even though it did the exact same thing as the parent drug. The legislature was constantly playing catch-up trying to add the never-ending list of new substances, and until they did, the substances were legal and the authorities couldn't do anything about them. The second case is the recent court decision regarding use of cell phones while driving. Again, the law intended to make driving safer by outlawing the use of cell phones while driving, but it was drafted before the proliferation of smartphones, and the lawmakers being not that technically inclined, specifically mentioned calls and text messages. The court ruled that therefore technically, only calls and text messages were illegal, any other use like playing games, was legal (the actual case was chosen to be a safe challenge and involved a person using their cell phone as a GPS for navigation). In both of these cases the narrowness of the law didn't allow for the laws to be used to prevent the actions they intended to.
So unfortunately, pick your poison: too narrow and lets edge cases or new technology get aware with murder (perhaps literally), or too broad and leave the discretion in the hands of the authorities.