Fate has always challenged Karna during his course of life. He has always faced degradation due to his association with lower caste. He was a born warrior however he did not get much chance to show his mettle and always fought for his rights.
A list of his misfortunes could be found here
But did he follow path of Dharma during Mahabharata?
The answer to this question is difficult to understand because his sins could have been justified with his personal reasonings but they were unjustified according to laws of Dharma.
Following are the reasons due to which his Karma lead to his destructions.
1. Supporting Duryodhana - Karna always supported Duryodhana during Mahabharata, he surrendered his life to him because Duryodhana made him the King of Anga Pradesh in spite of being born in low caste.
At one point this arguement seems justified. How Karna could have been gone against a person who has given him the respect he always deprived of. But the biggest mistake (Adharma) of his life was that he supported Duryodhana in all his mis deeds.
2. Insulting Dropadi - Karna insulted Dropadi and supported her rip abduction (Cheer Haran) when Pandavas lost again Kauravas during Gamble. Another major Adharma committed by Karna.
3. His misfortunes - Life has always been difficult for Karna in spite of that he always fought to prove his mettle. But Karna was a selfish person who always thought about his own good. He was never concerned nor did he tried anything for the upliftment of his caste.
These 3 were the major reasons which lead to his unfortunate demise during the Mahabharata.
During the war when Karna's chariot wheel was struck in the mud, he was killed by Arjuna. At that time he was not carrying his bow and also forgot all his spells due to curse of his guru Parshuram. His death was a result of his errors which he committed /9knowingly/unknowingly) during his course of life.
Three things we can learn from Karna is
1. Never blindly follow a friend who is in the path of Adharma.
2. Always respect woman and stand up for their rights.
3. Try to work towards upliftment of society from poverty, illiteracy, casteism and other diseases.