I seriously do not see what the whole beef is. I know it’s because most ficcers who write OCs write shitty ones that turn into Mary Sues, and a lot of them are glamorized author insertions. That’s called BAD WRITING and it can happen in original fic too (Jane Auel, I’m lookin’ dead at YOU!). Usually, when the bad writing happens, there’s a lot of OOC going on all around. Suddenly, uber-competent canon characters are blubbering idiots while Mary saves the day and their asses. The babe magnets in canon suddenly change their whoring ways and become utterly devoted and faithful to Mary. Basically all sorts of bullshiggity goes on.
But mostly it comes from not thinking of characters as PEOPLE and not just puppets to push around on a paper or computer screen. An individual will do certain things and not do others or do things a certain way and not another way because of that individual’s makeup. An individual with a very strong code of ethics will find it very hard to violate them. Someone with loose morals will probably just go for expediency and damn the means. If you’re going to have them do otherwise, then you’ve got to set it up in the story to show WHY they’d act OOC. You can’t have a character be a mewling coward the whole story and then suddenly whoop a squadron of space troopers without showing me the transition from personality A to B.