I wanted to share this it's quite interesting to think about especially with how this site likes to annalize over everything in this series. It points out many reasons why we love Barney most and why Ted isn't such a good guy afterall.
Barney doesn’t quite make sense, until you take into consideration the premise of the show. Everything in the show is an account by Ted Mosby as he regales his children with the story of - you guessed it - how he met their mother. So perhaps this is just the version of Barney that Ted wants his kids to see.
Think about the final scenes of the series. The purpose of Ted’s entire story is to get his kid’s approval for hooking up with Robin. One obstacle he’ll have to deal with is that his kids know Barney, and know that he’s a long time friend of their father, and Robin was the love of Barney’s life. So when Ted tells his whole “I want to bang your ‘Aunt’ Robin, that cool?” story to his kids he casts Barney as a despicable character to justify to his kids (and himself) that this is OK.
Full article here!
http://houseofgeekery.com/2015/05/22/did-we-ever-know-the-real-barney-stinson-a-fan-theory/