The tradition of giving half-a shekel to the Temple of God dates back to the times of the book of Exodus, as we see at Exodus 30:11-13 (RSVCE):
The Lord said to Moses, “When you take the census of the people of Israel, then each shall give a ransom for himself to the Lord when you number them, that there be no plague among them when you number them. Each who is numbered in the census shall give this: half a shekel according to the shekel of the sanctuary (the shekel is twenty gerahs), half a shekel as an offering to the Lord.”
There were different taxes meant for the Temple and for the Roman Empire, as we read in Matthew 22:17-21 (RSVCE):
“Tell us, then, what you think. Is it lawful to pay taxes to Caesar, or not?” But Jesus, aware of their malice, said, “Why put me to the test, you hypocrites? Show me the money for the tax.” And they brought him a coin. And Jesus said to them, “Whose likeness and inscription is this?” They said, “Caesar’s.” Then he said to them, “Render therefore to Caesar the things that are Caesar’s, and to God the things that are God’s.”
In fact, the Jews were required to pay the Temple-tax using the drachmas bearing Hebrew inscription and symbols, whereas the tax to Romans would be paid using the coins having the imprints of Caesar. The role of money-changers in the Temple was to facilitate exchange of the coins, so that the faithful would be able to pay their Temple-tax and offerings in Jewish coins.