It IS going to the government. What causes inflation is when the government increase the money supply faster than the economy is growing.
Imagine a simpler monetary system with no fractional reserve banking and no electronic money. All money is paper bills. The government prints the paper bills, and then uses this paper money to buy things, thus inserting the new paper money into the economy.
So suppose that the economy of a certain place at a certain time is producing, say, 100 million unit of "stuff". There is 100 million dollars -- let's call the currency "dollars" for convenience -- in circulation. So each unit of stuff must cost $1.
Then the economy does not grow, but the government prints another $10 million of currency and uses it to buy things. What happens? There's still just 100 million units of stuff being produced. So there's now $110 million to buy 100 million unit of stuff. The price of each unit of stuff must rise to $1.10.
The government used this $10 million it printed to buy stuff. At the higher inflated prices, $10 million buys about 9 million unit of stuff. That 9 million unit of stuff would otherwise have been bought by private parties. So the government has taken 9 million units of stuff out of the 100 million, leaving only 91 million for private citizens. The government effectively taxed the people 9%. But the tax was subtle, because they didn't actually hand any currency over to the government. They paid the tax in the form of lower value for their money, i.e. an "inflation tax".
This isn't a hypothetical example. Many governments have tried to finance government programs by printing money. The result is pretty much always inflation.
Real life is more complex than my simple example. Most money today is not paper and coins but electronic entries on a computer. An increase in the money supply of X% does not necessarily result in EXACTLY X% inflation, because there's the issue of "velocity of money, that is, how many times is each dollar spent in one year. Etc. But the principle is the same.