The word spam, in this case, is not used to make refference to the almighty wonder of questionable food that is Spam, but rather a substitute for a curse word.
This phrase is usually used by an individual who is questioning a location but is also looking to cut back on their swearing.
Other similar phrases included 'what the spam' 'who the spam' 'why the spam' and ' how the spam'
girl 1: I think we're lost...
girl 2: Where the spam are we?!