It's not just a "valid way". This is the way taxes are intended to work! Taxes are not just a way for the state to collect money (maybe in the past centuries). They are also the main way to frame the economy.
Here in Germany, the term for "tax" is "Steuern" which means something like "controlling/steering/directing/governing". This is exactly the official purpose of taxes, and includes collecting as well as spending taxes.