First, a boy dressing up as a girl beyond a certian age (beyond awareness of societal regulations regarding gender expression) is generally a sign of gender identity disturbances, to the possible extent of Gender Identity Disorder. This doesn't make someone gay! Gender identity and sexual orientation have nothing to do with eachother.
But really, this issue revolves around the fact that children that age do not have any concrete awareness of what gender roles are- ask a three year old boy what he wants to be when he grows up, and he might say "mother." At this age, it's not really an indicator of anything save for well functioning imaginative play, which is very healthy.
This is, without exception, the only stage in a boy's life where he'll be allowed to explore gender and have it written off as 'being a child', and beyond that, there's a huge amount of stigma attatched to such behavior.. so, and this is purely in my opinion, I think it should be allowed and even encouraged for as long as possible. When he begins more actively interacting with peers, ie at the start of school, he will begin to interact with other boys and you can bet that his behaviours will "reslove" themselves overnight.
More to the point, regardless of any dress up he might do, there's a fair chance that he'll be gay, and even if he isn't, most men who fall more towards the "heterosexual" side of the kinsey scale still have felt SOME attraction to men, or in some cases acted on it. It's remarkably uncommon for someone to be exclusively heterosexual their entire lifes.
That said, what his parents are doing to him is beyond dangerous. That kind of attitude towards homosexuality isn't just going to possibly make -him- hate himself later in life- it may form him into a future homophobe, thus essentially creating more hate. In my opinion, prohibiting the playing he's doing so that he's not acting like a "fag" is no less abusive than beating him.