There are many reasons.
Stomach bug
Ate something that disagrees with you or "off"
Virus
Not eaten or had a drink for a while
Had too much alcohol to drink
Have a migraine
If you are worried call 111
they're among the rather large number of symptoms of pregnancy; but there are a good many other possibilities. If it happens again, see your GP (and tell him/her it's not the first time).
single people can get pregnant (I sometimes wonder if they outnumber the married people who do). Still, if you're sure you're not, then you might consider calmck's suggestions. If it happens again, though, see a doctor.