How to make a curve behave like a squeezed tooth paste (to born from a moving object but to stay on ground)
Wow, found a wonderful method.
You see, you can add a curve modifier to a curve, who knew!? :)

I made a CURVE profile to the ground that should be followed
Then I added the CURVE_toothpaste that is the shape of toothpaste coming out of tube and put a curve modifier to it, so that it follows the PROFILE
Then I animated the location of the CURVE_toothpaste
And also animated the location of the toothpaste_squeezer that followed the profile curve (note that the animation happens on the curve, not on the squeezer)

See the .blend for clarification

.Blend here: