The spacing grid is controlled by values in the registry, as explained in the accepted answer.
For those who don't like clicking around in the registry editor, here is the alternative for copy/pasting into the command-line window:
To see the current settings:
reg query HKCU\"Control Panel\Desktop\WindowMetrics" | findstr Spacing
To change it, use values between -480 and -2780. The default is -1125 (or -1128?).
reg add HKCU\"Control Panel\Desktop\WindowMetrics" /v IconSpacing /d "-1125" /f
reg add HKCU\"Control Panel\Desktop\WindowMetrics" /v IconVerticalSpacing /d "-1125" /f
To see the result, you need to Sign out and Sign in again. (restarting Explorer doesn't seem to be enough)
To change the icon size, you can click on the Desktop, and Ctrl-scroll with the mouse.