Saving file as .m causes it to save as comments
Only initialization cells will be saved as uncommented code.
Check Cell -> Cell Properties -> Initialization Cell and Initialization Group.
You can also use Code cells (instead of Input), which have the Initialization Cell property by default. Alt-8 or Command-8 inserts a code cell.
You can check that it is an initialization cell by looking at the top right corner of the cell which has an extra cross:
Anything which is not an initialization cell will be commented out.