The William & Mary Bill of Rights Journal has a lengthy article from 2009 on the tangled history of congressional chaplaincies that's worth reading for historical context.  This is an old debate and it mirrors the broader culture's religious evolution.  

Madison's early views are murky but he grew to oppose any intermingling of religion and governance.  

When Washington DC was established as the capitol, church services were held in congressional chambers.  

In the run up to the Civil War the chaplaincy was nearly abolished over the slavery debate.  

The position was also at times central to the 19th century popular suspicion of Catholicism and Catholic immigrants (similar to today's view of Islam and Muslims).  

A worthy read.  Prayers were offered in Congress form the start, and were a frequent source of controversy.  

http://scholarship.law.wm.edu/cgi/viewcontent.cgi?article=1045&context=wmborj&sei-redir=1#search=%22u.s.senate%20guidelines%20guest%20chaplains%22