A punishment such as imprisonment is associated with negative thoughts.
But the intention, at least in case of sentences in fair legal systems, is a positive one, to let the criminal reconsider the mind and to improve the behaviour.