How do I prevent this bath faucet from leaking while the shower is running?
You need to replace the diverter, which in your case is also part of the spout. This should be a relatively easy and cheap replacement. Usually the spout is held on with a set screw located in the bottom - you loosen the screen and the spout will twist/pull off.  Replace it with a new spout and diverter, tighten the screw and enjoy!