"Billy is a girl in his head so does that mean he fancies blokes, as most girls do – and if he does, him being biologically a bloke, does that make him gay?"
Not necessarily. Gender identity and sexuality aren't linked so neatly all the time.
"Additionally, why are lesbian, gay, bisexual, and transgender people all happy to be lumped together other under the LBGT flag – and why are they so determined to support each other?"
It's not actually always true that everyone is happy being under the same flag. Indeed, one of the last times this came up, kromo came along to explain why T and LGB should really be separate. It's a historical accident, of sorts, dating back to when both LGB and T suffered much more serious discrimination and persecution and wondered if uniting under a common cause would help drive things forward (slightly oversimplified). Maybe the time will come when they are regarded as separate again, although probably that will also be the same time when the LGBT awareness campaign as a whole is no longer needed.
But in a simple sense the commonality is that both are regarded as challenging the gender and sexual norms, and both suffer similar discrimination issues. So they are linked in terms of how society perceives them, but probably not much else.