Dear liza
It's certainly not because you are a virgin.
You probably have a Urinary Tract Infection, and drinking more water will probably help with the stinging. More water will dilute your pee. Painkillers (ibuprofen or paracetamol) might help.
How are you now? If you are still in pain, visit your doctor (UK?) or a pharmacist. You may need antibiotics.
You can pick up UTIs in a number of ways. It might be through not wiping yourself properly (always front to back - never the other way), maybe not washing you hands properly before touching your vulva. Perhaps using scented soap. Maybe the wrong type of underwear, or underwear not rinsed properly. It might be through vigorous masturbation, or a scratch in the urethral area.
Hope this helps. Let me know if I can help more.