There are dozens of reasons that may explain what is going on here and I'll try to list them in order of likelihood if possible.
The dispensing hose is too short or too wide. For standard PVC hose, you need about 10-12 feet and it HAS to be 3/16" ID. Not 4 feet of 3/16 or 5 feet of 1/4". This seriously matters and if you have anything except 10 feet of 3/16" ID tubing, stop right here and fix that.
The beer is overcarbonated and you're dispensing at a pressure LOWER than the current carbonation level. It's impossible to dispense beer cleanly with a pressure that is lower than the carbonation especially if your serving hose is too short or too wide.
You MIGHT have the long draw diptube installed under the gas in port on the keg. If that's the case, co2 goes in and bubbles up through the beer and foam dispenses out from the top. This will only happen while the keg is really full. As it empties, the foam will no longer reach the output and you'll just get mostly gas. For future reference the "in" port of the get is for Co2 input and the diptube is only about 1" long. The "out" if for beer output and has the internal diptube that goes all the way down to the bottom of the keg.
There MAY be a leak between the long diptube and the inside of the keg. This is is relatively rare, but it sometimes accounts for why a properly carbonated beer will spit a mix of beer and bubbles out of the keg forever. You'd see bubbles entering the beer tubing constantly and it never looks like just solid beer.
The pressure gauge on your regulator may not be accurate. This would result in either undercarbonation or overcarbonation (and dispensing at a very high pressure). The only way to know for certainty what the keg's carbonation level actually is given all the things you've done so far is to attach a pressure gauge directly to a gas QD and put that on the keg. Wait about 1-2 hours and then read the gauge. Note that, as well as the temperature of the beer and then look at the carbonation charts with those two data points in mind.
Note that when you describe what you did with a keg, we really need to know about twice as many details to help you out. It all matters. Did you chill the beer down first? To what temperature? When you rolled the beer around on the floor, what was the pressure? A video of the beer pouring and/or a video of the beer passing through the tubing, may help.