If there is no need to make the altitude change quickly I would fly at neither Vx or Vy, but use a cruise climb i.e. power up a bit/full power, speed more or less cruise speed, nose up a bit, retrim, and let it trickle up there. This has the added benefit, if you are navigating, of not changing the leg timing too much.
If you are talking theoretical it is because, as mentioned, Vy gives you better horizontal speed.