If they are your cats, keeping them in the house will solve the problem.
If they belong to someone else, you could talk to the neighbor(s) about keeping them indoors. This is often easier said than done. As for the soil, rake out the solids and bury them at another location. Then apply copious amounts of water to flush the remaining droppings from the garden soil.
If the neighborly discussion is not successful:
* Install a fence around the area. Or lay chicken wire fencing or some other barrier on the ground to keep the cats from digging in the soil.
* Use cat and dog repellents available at local garden stores. Effectiveness varies, and the repellents must be reapplied frequently.
* For feral (wild) cats, you could use a cage or box trap baited with wet cat food and then turn the animal over to a local humane society.
* Cayenne pepper (ground red pepper) has been claimed to work well as an inexpensive deterrent, but research is lacking.
Online Resources:
Controlling House Cats