There are various sources of accountability.
One is that the government itself regularly reviews its own departments, and if they aren't doing their job, they can get into trouble. For instance, if, say, the FDA suddenly got slack and started approving drugs without reviewing them, they'd very quickly find themselves explaining to an investigative committee what the hell they were doing.
Then there's the people themselves, who may chose to vote for somebody else if they aren't happy with the way the country is being run – as recently happened in the USA in a very big way.
The other thing to keep in mind is that most government functions are NOT money-making enterprises and nor are they meant to be, and so using income is a poor assessment of this. To use the FDA example again, its job is to determine if medications are sufficiently effective and safe to allow onto the market, not to make money. Indeed, failing to guarantee its income could actually impair its function. For instance, if the FDA was paid for every drug it approved, and not paid for drugs it did not, then there would be a strong incentive to improve them whether or not they were any good. Or indeed, if it was paid by drug companies at all, it would have an incentive to listen to them and do what they want- which is very much not what it is meant to do. The whole reason we have government agencies at all is to do tasks that aren't well-suited for market forces to dictate, for the very reason that they can get on with their job without having to worry about whether or not this turns a profit. Many services provided for the public good could never be profitable, so they can't be left up to the market.