The way Levi kneels down before Erwin at the end is like a faithful knight before his King. The Ackerman relationship with the people they 'imprint' on is always one of the faithful soldier fighting for the dream of his leader.
Levi does the exact opposite of what his instincts tell him to do...he gives up the dream of protecting Erwin for the sake of humanity, because it's only then that he realizes just how much Erwin's dream is actually a destructive and painful obsession.
Levi really does respect Erwin more than anyone, and cares for him.
Getting him to abandon his dream is the kindest thing Levi does for Erwin and that's why Erwin smiles..he's no longer a prisoner to his dream and the lie he sells to other people. He's finally free, and he makes the choice freely to give up his life for the sake of humanity.