Did you set the gmail up on the iPhone and your Mac.
Or did you sync your iPhone before setting up the gmail account on your iPhone? The sync of the iPhone should have gotten or Mail settings from OSX mail. One fix would be to delete the gmail account from the iPhone then sync the iPhone with your Mac to getting the gmail settings from your Mail account. Sounds as if you have too different settings conflicting with each other.