What was the main reason that Mr Darcy changed his attitude toward others?

Darcy has a contemplative nature, he is deeply in love, and he has been rejected. It is to be expected that he would dwell on why he was rejected, seeking to understand, and once understanding to improve himself.

Darcy says, in chapter 11, "But it has been the study of my life to avoid those weaknesses which often expose a strong understanding to ridicule." He is self correcting, if he thinks there is something wrong.

He is deeply in love, so much so that he cannot suppress it, even though he knows his family will be very upset if he marries Elizabeth. He is constantly reminded of this by Lady Catherine, whose intentions are clear: she expects he will marry Anne De Bourgh.

In examining himself and his situation, he was probably reminded of a lot of things that had escaped his notice before.

It was acceptable that he have Bingley as a closes friend, but Bingley was from a middle class family that had become wealthy, despite the denials of his sisters. By contrast, the Bennets were land owning gentry.

Lady Catherine was as ill bred and ignorant as Mrs. Bennet, and in fact she was worse because she was constantly meddling in the lives of other people.

Lydia's elopement was a scandal that could easily have happened to Georgiana, and with the same man.

When money was removed from the equation, Darcy's family was no better than Lizzy's, and this is a point Lizzy makes explicitly clear in her confrontation with Lady Catherine. He had two choices. Either he had to respect Lizzy's family, or he had to realize he could not respect his own.