This is caused by a malfunctioning diverter or debris within the valve/spout.
Replace the diverter. Please view our Find Your Product section to determine your model and the required diverter. Also, make sure the valve body is cleaned. In some models, the diverter is installed in the valve body; on other models it is installed around the valve body under the spout. If it is one of these models, make sure the spout is cleaned as well.
If the side spray does not shut off completely, it would also need to be replaced.