That’s not true, they both mocked Jesus. No information is given as to why in the last moments the thief on the cross had a change of heart and confessed his Faith in Jesus and His innocence.
And with him they crucified two bandits, one on his right and one on his left. Those who passed by derided him, shaking their heads and saying, ‘Aha! You who would destroy the temple and build it in three days, save yourself, and come down from the cross!’ In the same way the chief priests, along with the scribes, were also mocking him among themselves and saying, ‘He saved others; he cannot save himself. Let the Messiah, the King of Israel, come down from the cross now, so that we may see and believe.’ Those who were crucified with him also taunted him. [Mark 15:27-32
Then two bandits were crucified with him, one on his right and one on his left. Those who passed by derided him, shaking their heads and saying, ‘You who would destroy the temple and build it in three days, save yourself! If you are the Son of God, come down from the cross.’ In the same way the chief priests also, along with the scribes and elders, were mocking him, saying, ‘He saved others; he cannot save himself. He is the King of Israel; let him come down from the cross now, and we will believe in him. He trusts in God; let God deliver him now, if he wants to; for he said, “I am God’s Son.”‘ **The bandits who were crucified with him also taunted him in the same way.