It's petty to act in a juvenile manner towards a friend in retaliation for them previously acting that way.
It's the only way the friend will understand the lesson you're trying to teach them about their behavior.