Given below are the ways in which a ticket gets spammed :
1) An agent can mark the ticket as spam manually.
2) An automation rule would have acted upon the ticket.
3) The contact of the ticket would have been deleted or blocked. Restore the ticket > click on the Activities at the top right corner and check as to why the ticket has been spammed. Once you restore the contact, all future emails from the contact will come through as tickets.
If none of these were the reasons when checking the Activities please reach out to support@freshdesk.com and we would be glad to help you out.