Because you need something to breathe, in order to breathe.
The thing that prevents us from breathing on other space rocks is either their downright lack of any proper atmosphere (in the case of the moon) or the fact that the atmosphere they do have doesn't have the necessary gases that humans need to constantly process in order to live(namely oxygen).
However this doesn't just mean you'd need to pump a whole lot of breathable air onto a planet/moon to make them habitable. Our moon does not possess enough mass to trap in an atmosphere, it would just float away. Mars does have a strong enough gravitational pull, however since it does not generate a magnetic field, it's atmosphere is constantly stripped by solar winds(causing it to be very thin).
So in order to have a world where humans can breathe on, you need 3 things:
- A rock with a strong enough gravitional pull to maintain an atmosphere.
- A moderate concentration of oxygen within that atmosphere (not too high a concentration though, otherwise everything becomes very flammable, around 20% should do).
- Protection from solar winds (an internally generated magnetic field for example).