How would spam get into your contact list? Just sending a message doesn't auto-add it to your contacts (certainly not by default, though one could write a phone or message app that did that). And why would anyone hack your phone just to insert a strange contact? If I were hacking a phone I'd try to not let the person know, not put cryptic clues where they were likely to find them.
No, I don't know how it got there. "Finger trouble" is usually the simplest explanation for oddities, e.g. accidentally pressing the wrong button when trying to edit, delete or block something, but it's impossible to say just from the fact that you have something in your contacts list how it got there. Try typing the number into a search engine and seeing whether anything comes up (if it's associated with some spam or scam it's likely that others will have posted or asked about it somewhere).