A man who spoilt 320 facemasks with saliva and mucus in February has been given a 10-month jail term suspended for two years.