There are loopholes, however: The City of Philadelphia exempts religious institutions (though organizations receiving city money must follow the city’s employee discrimination laws). That issue gained prominence last year when the American Bible Society, a nonprofit in Old City, told its employees that they had to agree to a code of conduct including abstaining from sex before marriage, which it defined as between a man and a woman. About 20 percent of the more than 200 employees left after the new requirement was announced though not all of them cited the code of conduct as their reason for leaving.