That movie is based on a comic called The Dark Knight Returns.
The comic takes Superman's old motto of "truth, justice, and the American way" and explores the darker side of that. Superman is a metaphor for the American military-industrial complex. He's unstoppable and all-powerful... so how do we know that strength is being used for good?
That sets up the conflict between Batman and Superman: the street-level crime fighter against "the system" represented by Superman. It's not as simple as Superman being a good guy or war and politics being simple (umm). That's part of what makes this comic so great.
There are a ton of discussions on this topic, so I'd recommend a google search. This one is particularly interesting:
Miller is quick to point out the cost of Superman’s continued role as a costumed do-gooder: he’s called away by Reagan, and sent to intervene in the battle in Corto Maltese between US and Soviet Forces. He calls what he’s doing there “saving lives,” but it looks to me as though he’s little more than Reagan’s enforcer—a one-man branch of the US military. In exchange for a “license” and his life, Superman is required to remain quiet, invisible, and above all obedient
Here's another, posted just a couple days ago:
Miller positions Superman as Batman’s true rival, a polite water carrier for ineffectual elites and authority figures, a symbol of weakness and civil decline to which Batman provides the antidote. His Superman serves as a White House flunky for an unnamed president who looks suspiciously like Ronald Reagan, a subservient political henchman who projects American power abroad while cities decay at home.
And here is a paper that's pretty dense (and admittedly a bit obnoxiously "academic") but goes into this a lot more than I can:
This concentrated movement against conventional generic constraints simultaneously draws in the reader and excludes the sympathetic protagonist – effected through a systematic management over the formal principles of the comics page – positing the reader in a position analogous to that of Superman, who is at once both wholly subsumed into and continually superior to his position within the Reaganomic ideological superstructure of the comic.
In the second half of Dark Knight, the increasingly public nature of Batman's actions pressures the Reagan-inspired President to action, and Superman's mysterious presence in Gotham illuminates the indirect governmental control of the media. As one news anchor playfully alludes to the classic mantra of Superman – faster a speeding bullet, more powerful than a locomotive, etc. – her counterpart repeatedly attempts to curtail these statements before lamenting "the last thing we need is trouble with the F.C.C."
Some people like this portrayal of Superman. Some people don't. But the answer to your question of "why did Superman go to war" is "MURICA".