Under the law, PE is mandatory, but you need to figure out what's really going on, because "embarrassed in front of classmates" is often just the tip of the iceberg. Maybe she's uncomfortable changing clothes, self-conscious about her body, afraid of falling behind in physical ability, or something specific happened that scared her. The solution depends on what's actually going on.
If it's genuinely psychological discomfort without medical reasons, a doctor won't give you a note, and the school has the right to require her to attend. But talk to your daughter about it in more detail and also speak with her PE teacher. Sometimes switching classes helps, or getting a separate changing room, or working out with the teacher for a modified version of the lessons. Some schools are willing to work with you if you write a statement requesting accommodation - not an exemption, but an individualized approach.
If there's an actual problem - say, she recently pulled a muscle, has a skin condition, or a serious psychological block - then a doctor can issue a note about restrictions for a period of time. But that's not "don't go," it's "go but don't jump" or "just observe for a few weeks." The main thing is not to ignore the problem but to find a solution together with her and the school.