Ernie was one of the first students to let slip to Harry (and anyone else within hearing range) that he was a Muggle-Born. He also said that he had been down for Eton when his Hogwarts letter had arrived, so even though he doesn’t outright say it, the reader gets the impression that his family is at the very least well off, if not positively rich. Yes, lots of British kids go to Eton whose families aren’t rolling in cash, but it gives you an idea of what his family is willing to go through to send him to one of the best private schools in the country.
Harry privately thinks of Ernie as being slightly (sometimes more than slightly) pompous, but never arrogant, and he is always willing to give someone a second chance, so when Ernie publicly apologizes to Harry, Harry quickly accepts his apology and they start over with a clean slate. They may never have become close friends, but because of that fresh start, Ernie was welcome to join the D.A. their fifth year, and became a fairly decent Defense student under Harry’s tutelage. Considering how valuable that group would become, to Harry and the rest of the student body, Ernie was fortunate to be a part of it from the beginning, and to be able to count Harry Potter as a friend.