While a virus can go through all but the most sophisticated masks, disease spread is to some extent a numbers game. Cloth masks do stop droplets to some extent and are therefore of real benefit in slowing spread - which is the numbers game. Surgeons have known this for many decades. Their masks are now much better, but anything that is kept from the patient improves their chances.
I wore the old masks in the operating room and I'm wearing one these days when in proximity of others.