I don't think this has been clearly answered in the show, and it has been a long time since I've watched the show. So if there are any errors in my answer it's my memory's fault.
Sherlock's brother in the BBC series is very wealthy and well connected. It's implied that it's his brother who gets Sherlock work as a consultant because Sherlock is too stubborn to find work for himself.
There are a couple of scenes in the show where Sherlock and his brother are at odds with each other, but it appears that Sherlock is somehow dependent upon his brother.
At one point in the show his brother mentions something like "If you applied your intellect to business you could earn a good living". Implying that Sherlock doesn't earn any money, but I always took that scene as an indication his brother supports him financially. So I think it's his brother who receives payments for Sherlock's consulting efforts, and in turn pays for Sherlock's living expenses. I don't think this is the source of his wealth, but more of a brotherly burden.
In the episodes where Sherlock helps the Queen. His brother is the one who arranges for Sherlock to go to Buckingham Palace, and it appears that his brother is motivated financially and has to convince Sherlock to take the job.
There are a few scenes in the show where Watson is left with the tab and has to pay for things like the news paper or a restaurant bill.
Money to Sherlock is either unimportant or other people's problems. So it seems clear that he's not directly responsible for paying the rent bills.