Have a look at `smartSpacing`: (see Xmonad Spacing Docs)
> Surrounds all windows with blank space, except when the window is the only visible window on the current workspace.
I.e., changing
tiled = spacing 5 $ Tall nmaster delta ratio
to
tiled = smartSpacing 5 $ Tall nmaster delta ratio
should to the trick.