That's because when wood fibers get wet they swell across their thickness, but not in length. For instance, as boards dry, they get smaller in width and thickness, but not length.
Structurally, think of MDF as very thick paper. The wood fibers in are all pretty much laying down in a single plane. So when it gets wet it increases a lot more in thickness.