Well, sex is a rigourous activity. Anything that uses a lot of energy can leave you tired, but there's one big difference: the orgasm.
When you masturbate or have sex, your body builds tension to a point where it is released. After orgasm, the muscles in your body can really relax; many people also feel emotionally and mentally relaxed as well.
This can lead to a state of sleepiness, which is almost as good as the orgasm for some people.;)