It is important to first identify if the allergy is due to the injection. Generally, drugs like penicillin, which are prone to allergies, do require skin tests. In your case, I don't know what kind of needle it was. If the allergen is that needle, then the hospital is fully responsible.
Identify the appropriateness of that needle. You can go to another hospital and ask if your classmate is a good candidate for that shot. Whether that shot requires skin test etc.
Before that, keep the hospital prescription.