Re: The Design & Origin of ULTRON
1) Hank Pym creates it at the behest of the World Security Council, who want an uber-AI threat deterrent as an alternative to loose-cannon superheroes.
2) Thanos is able to take control of the Ultron AI from afar, and turns it into HAL on steroids, including a nifty "I Robot" self-replicating system to create an army of Ultrons.
3) Prior to this, and after IM3, Tony creates the Extremis Armor. Bad move. Evil Ultron is now able to hack into JARVIS and take over the suit completely. We see the whole Mighty Avengers saga where Ultron took over the Iron Man suit. (Probably leaves out the whole Nekkid Wasp angle, though. Pity.)
I want something good to die for, to make it beautiful to live.
---- Queens of the Stone Age, "Go With the Flow"