Not that I am justifying the behavior of anybody who causes violence toward others, especially on the scale that Loki has, but bears mentioning that prior to being sent to Earth, Loki had been tortured, threatened, and psychologically manipulated by Thanos to be his instrument. Of course, he still could've refused, and that's something he needs to live with. His personality was at play, along with his personal issues, but he was not acting fully on his own accord, and I don't think he would've attacked Earth on his own. He wasn't in his right mind, and has been paying for it, since then.
As far as Loki's actions afterward, he has fought beside Thor to save Asgard's people from being slaughtered by their sister, Hela, and her dark forces.
If you only consider actions since the Portal brought him here, then he's helped defend the cruise ship from pirates, as well as a Kraken. This happened before your arrival through the Portal, so naturally you wouldn't have known this. I was also told by Loki that he's helping Tony by using his magic to detect the presence of Infinity Stones.
You are entitled to your opinion of Loki, and I won't ague that he hasn't done bad things, but knowing these facts may help give you a more complete picture.