I'm a big fan of Rob Redmond, who talks about this in one of his blogs:
I am not a big believer in the idea that karate makes us into better people by increasing our levels of morality or maturity. Nor do I think that karate training is responsible for changes in personality. It has not been my experience that karate training is useful for improving character. There are many reasons that I do not believe this to be the case, such as the fact that karate schools generally do not define character to begin with, have no specific exercises for character development, do not have any way to measure character objectively, and do not have any way to check for changes in character. Character is not assessed, it is not tested for, and it is not trained with specific exercises.
Rather, a passive approach of just doing karate while hoping that the training has positive side-effects on personality, morality, or maturity through osmosis seems to be the way that karate instructors merely hope to train character. I find this approach to be to be less potentially effective than merely reading a not-so-good self-help book. But I also do not believe it is the job of a karate instructor to try to make us better people. Rather, their job is to teach the skill of doing karate well.
Redmond goes on to assert that, while martial arts training might improve our self-discipline and self-confidence, neither self-discipline nor self-confidence are inherently moral things, and they can be used for good or for evil.