As one experiences compassion, one comes to value compassion; or with gratitude, one comes to admire being gracious, and consider gratitude a virtue.
When someone feels compassion, they come to value it; similarly, when someone is grateful, they come to admire gracefulness and see gratitude as a positive quality.