I would not punish her, though I can understand your worry and apprehension. She is 17 and within one year of being considered a legal adult. This is an opportunity to have a serious talk about life, choices and the consequences of those choices. The fact is that for most people, the urge to have sex is as fundamental and strong and the need to breathe. You can punish and set expectations and limitations, but the fact is that if she wants to have sex and she feels that she can't talk to you about it, she'll do it anyway, behind your back, without your guidance and counsel. She is doing something that is natural to every living thing. If you punish her, you may send a message you don't intend, which is to intimate that sex is bad or sinful or something to feel guilty about.
The other thing to consider is, that no matter how we raise our children, somehow, they still develop their own interests, values and logic, which may be inconsistent with how we raised them. That is because we are all individuals.
Since she's already done the deed, the best thing to do now is to make sure that she uses protection if she is to do it again (and she likely will), to respect her body and not to allow herself to feel pressured into doing it again, or doing it in a manner that makes her uncomfortable, or doing it with someone else that is not of her choosing.
There are no shortage of life lessons to be learned here. Tread carefully...and good luck.