I've seen a headcanon somewhere that said that Equius didn't die smiling because he was killed by a highblood. He died smiling so Nepeta would not remember him sad or afraid. And I think that's the real reason he smiled as he died.
Okay, but seriously? Karkat is like, the sweetest guy ever! He suppresses all of his motions in order to maintain some sense of leadership, and even when shit goes to chaos, all he ever does is out of the best interest of his friends.