Rationalizing, where you give an after-the-fact reason that wasn't actually your reason (often it is assumed that it is better, or at least more acceptable, than your actual reason was), has a very bad reputation, but as time goes on I think this reputation is largely -- not entirely, but largely -- undeserved. Claiming that an argument is merely a rationalization is often taken to be quite damning to the argument, but, of course, that an argument is a rationalization doesn't actually tell us that it's a bad argument. It may, in fact, be an excellent argument -- it's just after-the-fact. And if it's a bad argument, this will be for reasons that have nothing to do with the fact that it's a rationalization.
I suspect that plausibly identifying something as a rationalization is mostly taken to undercut the argument in a purely moral way, the implication being that it is somehow dishonest to put the argument forward because it was not one's real motivation. This may well be the case sometimes, and perhaps often, but it doesn't seem to be generally true that rationalizations are dishonest. One of the reasons to deny the suggestion that rationalizations are dishonest is that the only thing that distinguishes a rationalization from an argument that is not a rationalization is the circumstance in which it originated. Rationalizations, once out there, work exactly like any other argument: they can be examined like any other argument, confirmed like any other argument, refuted like any other argument, acted upon like any other argument. What is merely a rationalization one day may be your real reason for acting, or one of your real reasons for acting, the next day. This fact that rationalizations can lose the illicitness of their origin by beginning to be used the right way is, I think, an important phenomenon, and probably describes a large number of arguments. We could call this convalidation. (The term comes from canon law, and is used to describe procedures of recognizing previously invalid marriages as valid once the impediments to them have vanished, or once a special dispensation has been obtained. So, for instance, if a couple violates a canonical requirement for valid marriage simply because they did not realize that it was a requirement, but later recognizes this and also recognize that there is nothing preventing them from conforming to the requirement now, they can go to the proper authority and get their marriage convalidated. Under canon law the usual reason for this is Catholics not marrying according to proper Catholic form, which usually requires redoing the ceremony, but not all convalidations require doing the whole thing over.)
A rationalization is convalidated, then, when it is no longer merely a rationalization, but is put to non-rationalizing use, usually by being confirmed or by being acted on. Again, I think it's absolutely essential to recognize something like this because:
(1) Rationalizations differ from non-rationalizing arguments only in the sense that they fit differently into the background motivational framework; in every other respect, they are arguments like any other, and assessed like any other.
(2) The role an argument plays in its motivational context can and often does change. Everybody has the experience of this, and rationality requires it. Thus rationalizing arguments can become nonrationalizing arguments if the motivational context changes enough.
(3) Evidence from cognitive science (and ordinary experience) strongly suggests that we rationalize a lot, but only condemn egregious cases. So, at least in practical life, either some rationalizations are legitimate or they can be made so. Further, what is pretty clearly a rationalization at one stage is often not treated as a rationalization later on.
(4) Chaining rationalizing arguments permanently to their defective origin runs into the dangers people worry about when they talk about genetic fallacies. Actually, I think most of the above suggestions can be derived simply by asking about the relation between rationalization and the genetic fallacy. (I don't actually think that genetic fallacy is a helpful fallacy-label; genuinely fallacious examples that go under the label are always better placed under another label. But I do think that when people are worried about the danger of genetic fallacy they are often worried about something that is genuinely significant and important.) Surely the origin of an argument is not universally relevant? But as times change a relevant origin may become an irrelevant origin.
It's surprising that there is so little work on anything like this, but there surely needs to be work on it.