Using spaces makes it so formatting for things like comments, or for loop indentation is more likely to be the same across text editors.
To make it so that vim inputs spaces, add the following to your vimrc file ( usually /etc/vim/vimrc ):
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
Another interesting tweak is set number (and its twin set nonumber) to display line numbers.