A few factors I can think of:
The rovers launched in 2014, and they were designed well before that. I wouldn't be surprised if the camera hardware was decided on in 2010
A normal camera in space is going to have problems. I'm not any sort of camera expert, but I can imagine there's a _lot_ of electronics in one. There's the sensor. That sensor may be hooked up to an analog to digital converter, which might be hooked up to a processor that converts whatever the sensor reads into a compressed image. Someone who is familiar with how cameras work can probably think of a dozen bits I'm missing :)
All of those bits of silicon are going to get bombarded with radiation, so they need to be radiation hardened. Smaller transistors are especially susceptible to radiation, so your radiation hardened chips are going to be bigger, more power hungry, and generally not as good as more up to date ones. From looking around online, it looks like the best rad-hard cameras today are only a couple megapixels.
I'm not sure about this case, but often times cameras not a priority for a mission. They're great for generating PR and excitement, but in terms of scientific value there's lots of other instruments that may have higher priority (both in terms of the design, and in terms of available bandwidth for returning data). If the cameras are just there to make sure the rover doesn't crash into something, they're probably using a wide angle lens which helps with navigation but can cause distortions.