Gastroenteritis is most often caused by a virus. It spreads through contaminated food or water, and contact with an infected person.