Ultron believes that humans are the problem, and thus they cannot be a part of the solution. He says:
I know you're good people. I know you mean well. But you just didn't
think it through. There is only one path to peace... your extinction.
According to Marvel.com:
Ultron decides that the best way to save the Earth is to destroy all
the people on it to ...