But this was likely the point. Audiences who have been following the series love Loki and know how powerful he is. So, by having Thanos kill him off with barely any effort at all, it establishes ...
Loki made a valiant attempt to stand up to Thanos in his own way. He pretended to kneel before him and willingly give the Tesseract away, but he attempted to kill Thanos with the use of his illusions.
While the Mad Titan claimed to be a warrior of justice, Thano's Snap might have been less impartial than we first believed.