Your spout has a simple valve inside. When you pull up on the plunger on the spout, it shuts off the water that would normally come out of the spout.
Now, the water has no place to go except up the pipe to your showerhead. And when you turn off the water, the reason water keeps coming out of the spout for a little bit is that it's draining the water in the pipe that runs up to the showerhead.
Your valve in the spout is shot. The spout screws on....and unscrews off. Simply unscrew the existing one, take it with you to the store, and buy a new one, ensuring the pipe thread size is the same. Most are 1/2 inch NPT.
Screw on the new one using Teflon tape wrapped on the threads...wrapping in a clockwise manner so the tape doesn't try to come off as you're tightening it.