this doesn't address the reasons WHY people foundation spam which are to prevent others from building, others from placing cannons to raid, or just to grief your enemy.
Implement the rule you mentioned for structures not owned by the settlement owner and start the decay timer once the person is out of render range, not when they log out. Cut the timer in half for underwater structures too because the no-build radius on those is absurd, I can't even build on half of my coast because someone has like 5 stone foundations underwater in an area I can't reach.