My classmate who had to be absent for medical reasons asked me for the professor's email. I don't want to give it to them.
Why are you trying to make their life harder?
To teach her a lesson, she shows no one any form of respect.
I understand that you might be upset with your classmate, but that is not a valid reason not to share the professor's email. You should be helping your classmates, especially if they are falling behind for medical reasons, not due to laziness. You should talk to that person and give them the support they need, or else they won't be helping you when you need it.
I don't really care. I'd rather she gets in trouble for the absence.
I do not think that that is your job to punish her. It is not okay to refuse to help classmates by not giving them all of the information that they need.