The bunk bed concept often surfaces but see https://travel.stackexchange.com/q/21713/4188
Real estate (as in space) on a plane is probably the most expensive in the world. While airlines reserve space for (for example) a bar in business class (and to the best of my knowledge only in the A380) a gym would use too much space.
There's also the issue with turbulence to consider, which would make a gym (at least without significant adaptions to the machines) rather impractical.
Offering a cheap (or at least significantly cheaper) option to lie flat would eat into their own revenue.
Few people can manage that