I heard a couple of times about a theist making the claim that the only reason that someone was an atheist was so that the atheist could do whatever he wanted without being held responsible. I've also heard an atheist complain about theists making this type of accusation. What really gets me is that the theist didn't offer anything to support his claim, and the atheist did not offer anything to support the opposite (not that he even claimed the opposite was true). Either way, both people were simply complaining about the other.
I want to offer a couple possibilities for why this might happen. First, I want to make it clear that the initial claim by the theist is an ad-hominem attack. The accusation targets the atheist's character. This has no bearing on whether the atheist is right or wrong, or whether or not his arguments hold up to scrutiny. As I mentioned in my post "This Argument is Full of Crap!", ad-hominem attacks typically start showing up when the person attacking feels that their argument has been overcome or that the opposition's argument cannot be answered.
This however, may not be the case in a situation like this. This may be a (poor) attempt by the theist to get to a deeper personal issue. Many of us have personal reasons for believing a certain way. Many of us also might be embarrassed by those reasons and prefer to keep them to ourselves. When we try to hide reasons that we may not feel to be solely adequate, we build up other arguments. Those arguments are a buffer that must be torn down before the real issue can be addressed. Depending on the level of embarrassment or hurt that is or was caused by that reason, we may or may not be willing to remove the buffer for others to address. Those who operate like this tend to be "tough nuts to crack" for those of us who want to reach people on a personal (not just intellectual) level.
Notice how I mentioned that the attack on the part of the theist may be the result of something similar to what he has accused the atheist of. He has accused the atheist of being unwilling to admit that he doesn't want to be held responsible for immoral acts (that society looks down upon or is in direct conflict with the theist's moral beliefs). Yet the theist makes this claim against the atheist because he may be embarrassed that he can't answer an argument he knows is legitimate. This, I believe, is more often the case than the possibility I described in the last paragraph (I included that paragraph because I wanted to acknowledge that it does happen).
Now, is the atheist justified in complaining about the attack? Sure, but complaining is not addressing. In such a situation the atheist does not have to acknowledge that the theist is correct or incorrect about his motives. He could simply point out that his motives do not determine truth, nor do they hold bearing on the validity of his arguments. The atheist also has the option to defend against the accusation. Who the atheist is talking to may determine which option he takes. The first is quite easy, but it could be interpreted by the theist as a verification with an unwillingness to admit or defend the unsavory position. The second is tougher, takes more time and patience; but if it is conducted properly, the theist can be stopped in his tracks. Of course, the second option is also a red-herring, so it may not be the best choice in a formal debate; but casual conversations rarely stay "on topic", so it may be appropriate and may be worth the extra time and patience to clear up some confusion there. I must caution the atheist that if the accusation is, in fact, true; then he will have a difficult time with option two for obvious reasons, and option one will be the only option available; but then the atheist is in the uncomfortable position of being psychoanalyzed correctly by his opponent (who wants to admit that?!).
Of course, this can all be turned around to where the atheist makes the claim that the theist only believes there is a God for any reason that is not valid (such as "indoctrination" by a parent or church). All my observations and recommendations follow here too. Its just the other way around.
Now that I've gone through all this, can it be prevented? What if the theist suspects that his candid claim is true? What if the atheist suspects that his candid claim is true? Neither of these should be ignored because they are foundational, and if recognized by the accused may lead to a fundamental change in worldviews. My suggestion is that if one wants to address this touchy subject, they need to be patient. This kind of intrusive accusation is best handled by a trusted friend, and even then, it needs to be slowly "teased" out. An abrupt accusation like the ones discussed above is one of the quickest ways to lose the trust of a friend.