He chose to be mistreated with the people of God rather than to enjoy the fleeting pleasures of sin.
In context
23By faith Moses, after he was born, was hidden by his parents for three months, because they saw that the child was beautiful, and they were not afraid of the king’s edict. 24By faith Moses, when he had grown up, refused to be called the son of Pharaoh’s daughter. 25He chose to be mistreated with the people of God rather than to enjoy the fleeting pleasures of sin. 26He considered the reproach of the Christ to be greater wealth than the treasures of Egypt, because he was looking ahead to the reward. 27By faith he left Egypt behind, not fearing the king’s anger; he endured, as one who could see the invisible.