Well, it COULD be that Game Freak just wanted that... but lets go through some other possiblities:
Some Pokemon, such as Latios and Latias can easily be determined as male and female because of their coloration, and other Pokemon have different characteristics that distinguish their sex. But what about the non-breeding single gender Pokemon such as Cressilia? Since there is only one gender how do you know that it is female or male if there is nothing to compare it to? Now lets take your example, Heatran. The gender ratio is 1:1 for male and female. Now, what is the point of having two genders of the Pokemon when it is STILL unable to breed, just like non-gender legendaries?
All the could-be plausible paths to go with this question end up right back where we started because nothing adds up to a definite answer. Some Pokemon have two genders, some have only one, and some don't. But there is no proof in the Pokemon games as to WHY. I think the best way to put it would be, how many licks does it take to get to the center of the tootsie pop?
I don't think Game Freak really thought about it in depth before they put it into their games, either that or they just wanted an excuse to not breed legendaries. Which still doesn't make sense because Heatran is considered a legendary and it DOES have both genders. See? Right back where we started..
Hope this kinda helped
~Excadrill444~