If you buy pre-painted, you'll get spray-painted regardless if it's MDF or wood. With a spray-painted surface, I think it matters less. If you want some life in it, choose wood and hand-paint.
I mostly have wood, but despite an old house, I have chosen MDF for the returns and windowsills when replacing windows. They will be hand-painted, and I think the result has enough life (compared to having to put knot sealer on wood and then paint).
But as usual, tastes differ!