FORTUNE -- When Carlos Greene worked in retirement planning for a major mutual fund company, none of his colleagues knew that he was carrying nearly $40,000 on five different credit cards.
The debt built up quickly after a few key decisions Carlos, now 49, and his wife Katherine made when they moved to Cincinnati for Carlos's new job: deciding Katherine would stay home with their young boys without crunching the budget numbers, then buying a big house and a nice new car. Pretty soon, Carlos was on a strict budget, unable to drive anywhere but work or home because of the cost of gas, limiting family entertainment to movie night at home, and juggling bills at the end of every month to get them all paid. The low point came when he covered the holes in his dress shoes with cardboard when it rained, since he couldn't afford to replace them.
"It became extremely stressful, and I was thinking, 'I'm in the financial services industry, I should know this. I should have planned this out better,' " he recalls. "It's hard for a man to swallow. I felt so frustrated and upset with myself."
He's not alone in his failure to follow his own professional advice. We've all heard the stories of prosecuting attorneys who break the law, spiritual leaders who preach modest living while amassing fortunes, headhunting firms with disastrous CEOs, and primary care doctors who are overweight and smoke. But is there a lesson to be learned beyond appreciating the irony (and perhaps a bit of schadenfreude when a moralizing politician is caught with a prostitute)?
It’s first important to understand what may drive a person who built a career following one philosophy to personally indulge in the exact opposite. It could be that he chose a profession in an area of temptation as a defense mechanism in an attempt to protect himself from an inner flaw, says Ben Dattner, an organizational psychologist and executive coach based in New York.
"There can be deep psychological reasons for that," Dattner says. "The areas that fascinate you can also be your areas of weakness."
For instance, someone with a strong rebellious streak may choose a law-and-order profession to try to curb that flaw, or an anorectic may become a gourmet cook who enjoys watching others eat. But in times of stress, a person is prone to succumbing to the suppressed trait that led to his career choice, whether breaking the law or binge eating.
These individuals may be trying to compensate for a weak spot by developing strategies in work life that help combat it. Someone who's chronically disorganized may become a professional organizer to find solutions to her chaos. Even if she can't consistently apply those strategies in her own life, she can easily understand her clients' struggles and give them useful advice. "We're often best at doing for others what we're worst at for ourselves," Dattner says.
Peter Schweitzer, 60, rabbi of The City Congregation for Humanistic Judaism in New York City, grew interested in Judaic studies in college and decided to become a rabbi in the Reform movement, despite the fact that he had never really given his beliefs in God much consideration. But later, as a young rabbi officiating at funerals, where the 23rd Psalm was standard fare, he found he could no longer bear to tell mourners to find comfort in a God that was anything but caring in those moments.
"There is pain. We do need to moan. We are upset right now. This is a tragedy," Schweitzer recalls. "It was getting too hypocritical for me to be me. I said, 'I have to be honest; I can't do this any more.' I have to find a new path."
He worked in publishing for a while and became a social worker before finding his way to Humanistic Judaism, in which many different beliefs are accepted and a premium is put on honesty. He volunteered as a rabbi in his current congregation before it grew large enough to offer him a paid position. Schweitzer says he feels he's a more compassionate and effective rabbi to members of his congregation who question their beliefs because of the path he took.
"I'm clearly an atheist. I don't wave it around," he says. "It's not what we don’t believe, it's what we do believe that matters ... I believe in human ability to face things. I believe in resilience. I believe in humor, courage, thinking. I believe in the strength of community. It's very, very powerful and it transcends lots of things."
As for Carlos Greene, after hitting bottom with soggy cardboard in his shoes, he and his wife overhauled their lives to reduce expenses, pay down their debt, and avoid filing for bankruptcy. They sold their five-bedroom dream home with a finished basement and moved into a small two-bedroom townhouse where their two sons shared a room and the dog slept wherever she could. It took nearly three years of scrimping and saving to pay down the credit cards, and both Greenes vowed never to fall back into that hole. The next time they moved, they spent less on a house than they could afford. And he began taking the free seminars and educational opportunities that his firm provided, to improve his budgeting and personal finance skills.
More than a decade later, Greene says he feels that the experience has helped him in his work as a financial services professional. "I see our clients and our customers as real people. I have a lot more compassion for where they are," he says. "It gives me greater perspective on asking the next-level questions to make sure they're in a good space to truly be able to save for retirement."
Indeed, Dattner says that when evaluating a professional who doesn’t practice what he preaches, the key question is to ask whether he slips up once or twice, or if he perennially violates the rules he says you must follow -- with no sign of reforming. The latter individual is a hypocrite who should be avoided, but the former might actually have more insight and wisdom to offer. After all, would you want a dietician telling you how to lose weight if that person had never struggled to stick to an eating plan?
"I'd rather have somebody who has the issue themselves; that makes them much more credible," Dattner says.