The High Court has dismissed a petition seeking a religious exemption to allow the use, possession and cultivation of cannabis for worship.