Real people do not fit into convenient little boxes. They quite often do things that would be deemed to be out of character. Each person has their own opinions, which they vigorously defend regardless of any factual basis to their claims.
Friendship does not hinge on agreement. Good friends can disagree on many things, and yet still retain their bond. If you find a friend who agrees with you on everything, check to see if they have a slot in the back to put batteries in.
Since real people are not so accommodating, we must be mindful when creating characters. They will not always agree with the author, and that is good. I might be breaking every rule in the book, but I will still say it: the author is not always right.
After all, they are flawed human beings. But there is much to be learned, if one is honest. Through our characters, we are able to view life from the outside. We can distinguish what is genuine from that which is feigned.
Characters need not have all the failings of real people. It depends on what the story requires. Writing is a chance to imitate life, but still make a few improvements. Comedy and tragedy each have their place, and a good story will tend to have elements of both.
But above all, a character must be a person: one that you know and can sympathize with. You are there with them in good times and bad. For they are not just an enigma rolled up in an agenda. With the proper infusion of energy, characters can become very much alive…