To get emacs to stop inserting tab characters and insert spaces instead, use this in your ~/.emacs file:
(setq-default indent-tabs-mode nil)