Nice, Joe. Yes X did act "immorally" by his own understanding.
How can you assert that? After all, according to you, morality is entirely internal -- a matter of guilt and shame and nothing more. Thus, if X did not feel either guilt or shame, how can his act be considered in any way "immoral"?
That is why he had to rationalize the act; in doing so he tried to convince himself that he did not violate his own moral standards.
But, according to my hypothetical, X arrived at that rationalization before
he stole the money. He had already internalized an exception to his general rule that allowed him to steal in that particular instance
. Thus, at the moment that he acted, he was, by his own standards, not
acting contrary to his own beliefs. There was no contradiction, no psychic "dysphonia." In short, there was no internal moral conflict. He stole, and he stole with a clear conscience. How can you then assert that he acted "immorally"?
The "theft" might have saved his children from starvation, but inconvenienced a billionaire who could have done quite well without it.
What if he stole the money in order to buy some much-needed heroin?