Firstly, does your profession fulfill the requirements of Right Livelihood? If your work or business is not in weapons, human trading, meat, intoxicants, poison or anything in the spirit thereof, then it is fulfilling Right Livelihood. For now, I assume yes.
Secondly, although your profession fulfills Right Livelihood, the State requires and compels you to pay tax. So here, you do not have the intention to willingly contribute money to the government, but you do so because you are forced to and because you are a law-abiding citizen.
Thirdly, you have the opportunity to influence how your tax money is spent through the elections. So, here I assume that you have voted in the past at the ballot box (assuming that you are eligible to do so). It doesn't matter who got elected, as long as you have done your part.
Fourthly, you still have the opportunity to vote using your feet and move or migrate to another place.
However, the main point in my opinion is that, what the government does with the tax money, is not caused by your intentions and you did not pay tax with the intention of contributing towards warfare etc. Rather, you paid tax because you were compelled to do so.
The commentary on the story of the hunter's wife from Dhammapada 124 is relevant here.
The monks began to discuss the matter, saying, “So Kukkuṭamitta has a
wife, and when she was a mere girl she obtained the Fruit of
Conversion; yet she married this hunter and by him had seven sons.
Furthermore, during all this time, whenever her husband said to her,
‘Bring me my bow, bring me my arrows, bring me my hunting-knife, bring
me my net,’ she obeyed him and gave him what he asked for. And her
husband, taking what she had given him, went and took life. Is it
possible that those who have obtained the Fruit of Conversion take
life?” Just then the Teacher approached and asked, “Monks, what is it
that you are sitting here now talking about?” When they told him, he
said, “Monks, of course those that have obtained the Fruit of
Conversion do not take life. Kukkuṭamitta’s wife did what she did
because she was actuated by the thought, ‘I will obey the commands of
my husband.’ It never occurred to her to think, ‘He will take what I
give him and go hence and take life.’ If a man’s hand be free from
wounds, even though he take poison into his hand, yet the poison will
not harm him. Precisely so, a man who harbors no thoughts of wrong and
who commits no evil, may take down bows and other similar objects and
present them to another, and yet be guiltless of sin.” So saying, he
joined the connection, and preaching the Law, pronounced the following
Stanza,
- If in his hand there be no wound, A man may carry poison in his hand.
Poison cannot harm him who is free from wounds. No evil befalls
him who does no evil.
Also, the commentary on the story of Ven. Chakkhupala, the blind arahant, from Dhammapada 1, is relevant here:
While residing at the Jetavana monastery in Savatthi, the Buddha
uttered Verse (1) of this book, with reference to Cakkhupala, a blind
thera.
On one occasion, Thera Cakkhupala came to pay homage to the Buddha at
the Jetavana monastery. One night, while pacing up and down in
meditation, the thera accidentally stepped on some insects. In the
morning, some bhikkhus visiting the thera found the dead insects. They
thought ill of the thera and reported the matter to the Buddha. The
Buddha asked them whether they had seen the thera killing the insects.
When they answered in the negative, the Buddha said, "Just as you had
not seen him killing, so also he had not seen those living insects.
Besides, as the thera had already attained arahatship he could have no
intention of killing and so was quite innocent." On being asked why
Cakkhupala was blind although he was an arahat, the Buddha told the
following story:
Cakkhupala was a physician in one of his past existences. Once, he had
deliberately made a woman patient blind. That woman had promised him
to become his slave, together with her children, if her eyes were
completely cured. Fearing that she and her children would have to
become slaves, she lied to the physician. She told him that her eyes
were getting worse when, in fact, they were perfectly cured. The
physician knew she was deceiving him, so in revenge, he gave her
another ointment, which made her totally blind. As a result of this
evil deed the physician lost his eyesight many times in his later
existences.
Then the Buddha spoke in verse as follows:
Verse 1: All mental
phenomena have mind as their forerunner; they have mind as their
chief; they are mind-made. If one speaks or acts with an evil mind,
'dukkha' follows him just as the wheel follows the hoofprint of the ox
that draws the cart.