What if it's against your religion to sell liquor, cigarettes or nudie magazines? You shouldn't take the job if the duties of that job violate your moral or religious beliefs.
But I am free to open my own store that does not sell liquor, cigarettes or pornography. These pharmacists should be free to do the same.