NATO and UE admission has nothing in common... both are meant for a purpose...
Turkey will not Leave NATO, since both sides need each others... Turkey is the second Pillar of NATO and NATO is the joker card of Turkey...
As for the UE admission, that's another Q... yes religion may play smthing...but let's be real..; it's mostly bc of Turkey economic "future" power that threaten UE, and mostly the West side... they will lose their monopoly on a west-centric Europe... with a mastodonte in the East side... that will drastictly grow in only matters of years with the access of the full UE market...
Turkey will rival the likes of France/Germany etc..; in few decades...a nd that's BEING OUTSIDE of the UE... I let you imagine... if they are in it... A decade+ and they will be equal to the superpowers of UE if they get a place in UE...
Europe will always find escuses to push behind this admission... whatever by calling undemocratic behavior or not... Always an escuse... even if Turkey is a pure Democracy that surpass Europe... they will always find somthing...