Overall, because there are more ill-educated people than educated ones, religious attendance has a beneficial effect. But the benefit really accrues to the ill-educated. For the educated, religion (at least, the kind of religion widely practiced in the USA) might actually be harmful.
Religion And Health: A Double-Edged Sword
Tomas Rees has posted on the double-edged sword of religious worship and health. The money quote:
Posted by Tom Rafferty