While these types of issues may be difficult to prevent, there are some preventive measures that can be taken. Keeping children from putting their hands in their mouth when playing in the dirt. (Good luck with that). Having kids wash their hands after playing. Recognizing that bird droppings are a potential source of Salmonella, so placing sandboxes in areas away from trees and other overhead structures where birds may land (and poop). Sure, trees provide shade, and in Spain, it is probably better to be in the shade. However, structures such as large umbrellas may be used. Umbrellas or other movable structures can be beneficial in allowing the sand to dry.
CDC - MMWR
https://www.cdc.gov/mmwr/volumes/66/wr/mm6609a3.htm?s_cid=mm6609a3_e
Notes from the Field: An Outbreak of Salmonella Typhimurium Associated with Playground Sand in a Preschool Setting — Madrid, Spain, September–October 2016
Weekly / March 10, 2017 / 66(9);256–257
CDC - MMWR
https://www.cdc.gov/mmwr/volumes/66/wr/mm6609a3.htm?s_cid=mm6609a3_e
Notes from the Field: An Outbreak of Salmonella Typhimurium Associated with Playground Sand in a Preschool Setting — Madrid, Spain, September–October 2016
Weekly / March 10, 2017 / 66(9);256–257