The North in the American Civil War did not fight to end slavery - though the South fought to keep slavery - the US and the USSR did not join WWII to liberate death camps, and so on.
Does not mean that it’s not a happy thing when a country’s nationalistic self interest puts it on the good side of history in a question.