There can be various causes for spinning including conditions of inner ear
, generalised body conditions, eye sight issues and issues of proprioceptors of joints. That you also have pain in the ear, it could likely be a cause from the ear. As it is the first time, you need not be very worried; even viral infections could cause it. If it is prolonged and repeated I suggest you visit an ENT specialist
for a thorough examination.