While leg-lifting when urinating is a trait commonly associated with male dogs, it isn't unique to them. Some female dogs will lift their legs when urinating, while some males will urinate the traditionally female way by squatting. While intact male dogs spray their urine more frequently than females, and lifting the leg makes this easier, even a neutered male may lift his leg to urinate -- and even an intact one may squat.
Male dogs spray urine on vertical surfaces like trees and fire hydrants as a way of advertising their availability as mates. Their urine is coded with hormones that other dogs can use to identify them, and when your male lifts his leg, he is able to more easily mark a surface other than the ground beneath his feet. Even if he is "fixed" and not looking for a mate, he may spray urine simply to mark territory he considers his. Still, this doesn't make leg-lifting a universal trait. Some male dogs, particularly young ones, squat to urinate. Fixed or not, they don't develop the urge to lift a leg while urinating until they're about 1 year old -- even then, they may prefer to squat. This, along with the fact that some females lift their legs to urinate, indicates that no position is a universal default for male or female dogs.