If you have glass doors you may want the inside box to match the exterior colour of the cabinets.
However, if your cupboards are laminated with a durable white vinyl surface, it's usually unnecessary to paint them.
If they are dirty you can generally clean them up with a mild soap or something similar to Spray Nine.
Image
Image