Avengers: Infinity War - Why Every Victim Was ACTUALLY Chosen To Die
How He Died
Throttled to death by Thanos in the film's opening act, quite stunningly.
WHY He Died
The Russos have actually openly talked about their thinking behind killing Loki. It wasn't merely a means to complete his arc and show that he was fundamentally "good" (because, let's be honest, it probably wouldn't have lasted anyway) and nor was it a means to break Thor more. It was about showing that Thanos meant business, as Joe Russo said:
"Part of what we wanted to do, out of the gate, was to unsettle you as you're watching the film. You're sitting in the theater thinking, 'Most characters in the Marvel Universe have been safe for a decade.' And we wanted to knock you off-kilter and make the audience understand that the stakes were going to be significant and the cost was going to be very high in the movie."
And on top of that, writer Stephen McFeely and Russo also confirmed in the commentary that Thanos is dealing with some unfinished business with Loki when he kills him:
SM: "Remember, he [Thanos] had a relationship with Loki, even if it was off-screen where he entrusted him with a duty in 'Avengers 1' and Loki failed.