Judge: SD prison tobacco ban curbs religion rights