Some governments have written laws which require taxes to be paid before the money can be spent for any other purpose.
Typically, withholding is required to be done by the employer of someone else, taking the tax payment funds out of the employee or contractor's salary or wages.