There is never any mention of how they come by the money. Neither in books nor in any JKR interviews. I searched for "money", "funding", "tax/taxes/taxed", "ministry" and "government". Zero relevant hits.
The ONLY exception is a note in OotP that Malfoy has great access and pull with the ministry since he funds a lot of causes:
'What private business have they got together, anyway?'
'Gold, I expect,' said Mr Weasley angrily. 'Malfoy's been giving generously to all sorts of things for years . . . gets him in with the right people . . . then he can ask favours . . . delay laws he doesn't want passed . . . oh, he's very well-connected, Lucius Malfoy.'
Somewhat ironically, once JKR got all billionairish herself, headlines such as this could be easily found:
LONDON (Reuters) - Harry Potter author J. K. Rowling has donated 1 million pounds ($1.83 million) to Britain's ruling Labor Party to provide a much-needed boost to Prime Minister Gordon Brown as he fights for political survival. (src: Reuters feed, 2008)
... and she spoke openly about wanting to prevent Tories from passing laws she doesn't like, and using her celebrity status to sway people to vote Labour.
WARNING: Controversial political analysis:
Based on JKR's non-HP political writing (especially her essay on why she will never vote Tory), she belongs to a political/philosophical school of "money grows on trees, not comes from other people who are taxed". This was especially true when she was writing her first books (and she planned out all 7 books then) and didn't have much money.
So for her, the question of what it takes to make a normal economy function (and especially, how government funding is obtained) is utterly unimportant and un-interesting. She sees government (in the real world) as a benevolent entity helping people, NOT an entity which takes money from some people by force and gives that money (after siphoning off some for itself) to others. Not too surprising considering that her life idol (after whom her daughter is named) was an avowed Communist.
It's curious to note that in Harry Potter world, everyone with much money is evil/dark (ranging from rich Death Eaters to experimenting-bad-jinxes-on-first-years morally ambiguous Weasley twins), with the lone exception of Harry himself - the latter having been explained by Rowling herself as a Mary Sue moment "I did it because I never had enough money". She basically seems to firmly believe a standard Soviet doctrine of "You can't make money with honest work" - Weasleys vs. Malfoys being the prime example of that attitude, in many places in the books.
To plagiarize my own separate answer - to misquote an apocryphal Tolkien-derived work "The last Ring-Bearer": "It is rather hard to analyze the reign of the first Princes of Ithilien, Faramir and Éowyn, in political or economical terms – it appears that they had neither politics nor economics over there, but only a never-ending romantic ballad".
In other words, Potterverse has no economic system we can coherently and logically deduce or find, because Rowling didn't put one in.