There are spritual and scientific reason behind ringing bells. Ringing of bells has many health benifits too.
When being rung, its vibrating sound will instantly ward off any negativity in temple vicinity.
All the bacteria, microbes, and other harmful microscopic germs falling on the path of these vibrations get distroyed.