My GF hates it when I put her on speakerphone, because of the echo. My theory is its because the iPhone's speaker and microphone are so close together, the mic picks up what the other person says and repeats it back to them.
This is a problem common with many cell phone speakerphones.
Very good speakerphones are considerably expensive in and of themselves... and that is just talking of landline phone sets.
Sometimes the problem is more noticeable than others and it may be due to a transmission glitch... which you're simply going to encounter periodically with any cell phone whether you're on the speakerphone or not.