Idris Elba had accidentally announced before 'Age of Ultron' hit the screens that he and Tom Hiddleston had filmed together, and revealed their cameos with outrageous disregard for Marvel's secrecy rules. In contemplating the past, it really didn't matter if everyone knew they were involved, because their sequence was no more than a bad vision used to haunt Thor.
In that limited sequence, it appears that Hiddleston's performance was just too good for test audiences, who inevitably gathered more emphasis on his presence than its actual purpose. They couldn't take him out of the plot, and things got too complicated, which definitely wouldn't have happened if he's just phoned it in.
According to What Culture, even if Hiddleston wants to move away from the MCU, he wasn't bitter about the cut, saying: "It made sense to me when I saw the film. Ultron was the bad guy. That was important. And that's why Loki wasn't in it."
Who are these idiot test screeners who believe that a clear dream sequence contains a narrative thrust as an entirely different villain in control? Well, there is an answer for this, if people choose to believe they weren't all idiots. All the cases of the Avengers who see visions, they will have their worst fears (including Black Widow), but for Thor, somehow he sees a flash of a nature that will actually come to pass.
Frankly, it doesn't really make sense. But look at the audience why they have taken Loki's presence as something more in that context.
IB Times said the second 'Avengers,' like the first one, sets a pedestal role for future movies in the series to shape up the way Marvel wants them to.
Although Ultron was created to bring world peace, he still has plans to wipe out the human race. It's technically warped mind decides that peace can only be attained if human's destructive nature isn't there in the first place.