To add spaces to your Dock in macOS just type the following into Terminal and hit Return:

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock

I have a few of these to keep my Dock nice and tidy!