Question - how necessary is the Taj Mahal?
Nothing is necessary. However, if you are going to be in the neighbourhood, seeing the real thing in situ blows away every photograph or moving image of the Taj you have ever seen.
And, of course, Agra has many buildings worth visiting beyong the Taj; and two or three essential day trips.
https://www.lonelyplanet.com/india/agra/attractions/agra-fort/a/poi-sig/449177/356509
https://www.lonelyplanet.com/india/agra/attractions/itimad-ud-daulah/a/poi-sig/449183/356509
https://www.lonelyplanet.com/india/agra/attractions/jehangirs-palace/a/poi-sig/1324905/356509
https://www.lonelyplanet.com/india/uttar-pradesh/fatehpur-sikri
https://www.lonelyplanet.com/india/uttar-pradesh/mathura
https://www.lonelyplanet.com/india/uttar-pradesh/vrindavan
I am sad to have to miss out on Ajanta/Ellora caves but i understand its just not logistically possible in only 2 weeks.
It's a matter of priority. Ajanta and Ellora would mean a day flying to Aurangabad; a day for Ellora and a day for Ajanta; and then flying out of Aurangabad the next day. You have to give up something else to fit that time commitment.
My main interest is history and religion
For history, it's pretty difficult to beat Delhi. But equally Jaipur (with three forts and India's first planned city) has its share of history, and does Agra; and Varanasi is plain old. If you're inclined to ruins and deserted citadels, then Hampi. Mandu. Nalanda. Sanchi. Fatehpur Sikri. (and Delhi).
Religion is everywhere in India - it's unavoidable. If it's temples you want, then almost anywhere in the State of Tamil Nadu. Plus: Jaisalmer, Ranakpur, Mt Abu. Amritsar. Khujaraho. Ajanta and Ellora. Delhi.
Of historical religious significance:
Sarnath (easy day trip from Varanasi)
https://www.lonelyplanet.com/india/uttar-pradesh/sarnath
Bodhygaya
https://www.lonelyplanet.com/india/bihar-and-jharkhand/bodhgaya
Bhopal (for Sanchi)
https://www.lonelyplanet.com/india/madhya-pradesh-and-chhattisgarh/sanchi
(in which case, add Bhimbetka: https://www.lonelyplanet.com/india/madhya-pradesh-and-chhattisgarh/bhimbetka)
Nalanda
https://www.lonelyplanet.com/india/nalanda
Broader destinations of a religious bent:
Buddhism:
The Buddhist Circuit is usually regarded as: Sarnath / Bodhgaya / Kushinagar +Lumbini which is in Nepal.
Dharmasala
Hinduism:
The Seven Ancient Towns: Ayodhya; Mathura; Haridwar; Varanasi; Kanchipuram; Dvaraka; Ujjain
The Four Holy Dhamas: Puri (East); Rameshvaram (South); Dvaraka (West); Badrinatha (North)
The Four Maha Kumbha Mela Sites: Prayaga ( Allahabad); Haridwar; Ujjain; Nasik
The Chota Char Dham: Yamunotri, Gangotri, Kedarnath, Badrinath.
Sikhs:
Golden Temple in Amritsar. Damdama Sahib, situated in the village of Talwandi Sabo near Bhatinda. Keshgarh Sahib situated at Anandpur. Hazur Sahib is on the banks of Godavari in Maharashtra. Patna Sahib is situated in Patna the capital of Bihar.
Jains:
Ranakpur, Rajasthan; Dilwara (Mt Abu), Rajasthan; Girnar, Gujarat; Palitana, Gujarat; Patna, Bihar; Sammet Shikhar (Peak of Wisdom), Bihar; Sravanabelagola, near Bangalore.
Muslims:
Mecca Masjid, Hyderabad
Jama Masjid, Delhi
Nizamuddin Dargah, Delhi
Tomb of Salim Chishti, Fatehpur Sikri
Haji Ali Dargah, Mumbai
Ajmer Sharif Dargah, Ajmer
Dargah Hazratbal, Jammu & Kashmir