To play devil's advocate though - surely there's a time limit of some sort?
I mean, if i dropped caltrops in a dungeon 8 levels ago and 200 miles away, and then when I've got Sanctuary up and running in some completely unrelated encounter, a random wandering goblin comes along and stands on a caltrop - does my Sanctuary expire?
Or there's Glyph of Warding. I'm sure that if i have a pre-prepared Glyph engraved on a rock or something, and while under a Sanctuary I deliberately take the rock out of my pocket and show it to an enemy, and the glyph triggers - that'd certainly cancel Sanctuary. But if I'm resting in a dungeon, having cast Glyph on the door to the room I'm sleeping in, and 6 hours into my long rest the sound of footsteps outside wakes me up and i cast Sanctuary - and then the critter outside triggers the Glyph - what about then? What if i cast a Glyph on the outside of a mask and then put the mask on and cast Sanctuary on myself and wander around until i meet a bad guy, and then the Glyph goes off - what about then?
And of course by the strictest letter of the rules Sanctuary won't expire if i cast a non-instantaneous spell BEFORE I was under the Sanctuary, that then goes on to affect an enemy creature in a non-damaging way. So i could cast Eyebite, then an ally could cast Sanctuary on me, and then I could walk around under the Sanctuary's protection Eyebiting people at will and the Sanctuary would be unaffected. And it won't expire at all if i perform a non-spell action that affects another creature in a non-damaging manner, so long as i don't make an attack in the process. Turning Undead, for example, or an Enchanter wizard's Hypnotic Gaze ability.
Mind you, the intent of the rule is pretty clear, and if you try any of these dodgy exploits you deserve every bit of what your DM is going to do to your PC...