“I want/need/would like a coffee/a beer” is fine where I come from (UK) but we would not say “a tea/ a wine”. No idea why...
It might be due to standardised measures for coffee (big, small, espresso, etc) and for beer (0,5 l or 0,3 l, sometimes 1 l pints) that everyone knows, when for the tea - the cups have different sizes, the jug, etc. and saying ”a tea” would be confusing because it is served differently in (almost) every place.
Yes, it is pretty much just random and changes from region to region. And even from occasion to occasion. If I were buying a cup of tea I would usually say 'Could I have a tea, please?' but I would never ask a friend 'Do you want a tea?' English is just weird like that, haha! (From Ireland btw)
I speak English as my first language and it would not be uncommon to say 'do you want a black tea'. I would certainly not say this is wrong. Of course this is subjective; Janetpiano says she doesn't say this but I use it/hear it often. (I live in the south of England) Just goes to show there are no hard and fast rules
Reading the "A black tea" comments, it seems like maybe there's a significant regional variation factor here, as most of those comments were made by people from the UK. I'm from the US, and it would never occur to me to say, "I'd like A black tea, please." It would always be just, "I'd like black tea, please." (Fortunately, both are now accepted!) Curious, aren't they, these AmE/BrE differences? :-)