Let's ignore all the unnecessary cruelty throughout all history and the present and assume that you are right. It doesn't matter, because people will be forced into these choices by competitive pressures even if their intentions are good. If your government tries to build a wonderful utopia for humans with the power of AI and robotics, it will be devoting a smaller fraction of GDP to producing robots that produce robots that produce war robots, so its robot army will be exponentially smaller than a different country that devotes a larger fraction.
The reason we have some nice things in the modern world, flawed though it is, is because for the last few centuries the military-industrial meta has favored countries which let people have some political and economic freedom. In a previous era, the meta was knights and peasants; a country without knights would be conquered, a country without peasants would starve, and a country that did not give the knights power over the peasants would lose a civil war. It doesn't matter what people want; technology will diffuse, someone will play the game to win, and any countries that choose less optimal choices will just be swept away.
This is all broadly covered in Sapiens. That book is great as it is unsettling. Its hard to deny.
in any case, how is one country/power with winning on their mind getting infinite manufacturing and raw resources to construct this robot army?