spawn-protection ignored when facing other blocks
Problem
The spawn protection checks which block the player they is looking at, not where they place the block.
Example
Yellow = Inside spawn, should not be able to build
Green = outside spawn, should be able to build
Note: I'm taking the screenshots before placing the block.
Block can not be placed:

Block can be placed:

Block can be placed, but not destroyed:

The block could technically be pulled back by a Piston (not sure if that's a bug, too)
Fix
Check for the block location, not the focused block.