The oldest spiritual reference of Diwali is Vamana avatar according to Dashavatar book(Ten Avatars of Lord Vishnu).
When king Bali had defeated by the Lord Vamana. Later lord Vamana sent the Bali to the Hartal folk(पाताल लोक). Then all people who were scared by Bali, They celebrated like the festival and lit the lots of lamps.
Then new fresh reference is Lord Rama According to Dashavatar Book. We all know about the whole story of Ram and Ravana.
Ravana defeated by Lord Rama at Lanka during Ram's exile. After this war, Lord Rama back to his own kingdom Ayodhya. All the people of Ayodhya have been waiting for his beloved Rama since 14 years. So, they started a lit of lamps and a warm welcome to Lord Rama.