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?!
boy: Dude... what the spam are you wearing?