Your sparkplug spanner should have a rubber lining to keep the plug centred. But when you allow the spanner to tilt too much it leans on the insulator. Next time you may not be so lucky.
Go and get a proper socket set. When used with an extension bar this allows you keep the socket straight so you wont break the spark plug. Just in case it happens again, when the plug is loosened but still screwed in take off the spanner (socket) and check the plug is ok. If its broken, use a vacuum cleaner to suck out the pottery debris so it cant drop into the engine.
You can also use a bicycle pump (old type with rubber tube) to blow out any bits the vac wont take.