That's odd! Maybe he just doesn't like the food? Have you tried to feed him other things? He should be fed a variety anyway, so try something new and see if he will eat it!
When my fish eat they take in more than they can handle and keep spitting what they cant eat back out. Then they go back to what they spat out and go through the process again.
are you feeding a pellet or a flake? My goldfish will sort of 'chew' on the pellets until they are soft enough for them to swallow. It kind of fun to watch them charge a pellet and carry it to the bottom of the pond then let it go and chase it back to the top...