Just get an inexpensive hotel in Rome not far from the Termini station and get some sleep. Make sure it has a 24-hour reception desk, and let them know you are arriving late. I saw hotels in the Monti neighborhood for under $150 on booking.com, but that may not have been relevant to your actual date.
There is a direct train to Lecce departing at 10 am the next morning. It takes a total of 5 hours 50 minutes to reach Lecce. Buy your tickets in advance on Trenitalia to save some €€.
That departure gives you time to have breakfast, maybe go for a short walk and get to the station. You spend your jet-lag day napping on the train.
We did this last February, arriving at Rome FCO around 6 pm not midnight. We took a flat-rate taxi to our hotel near Villa Borghese, checked in, showered, and went out for a light dinner before hitting the bed. We booked the 13:05 train to Bari the next day so we would have time to walk around in the morning, and that was good. We did nap a bit on the train, and the following day we felt fine.
But if you are in a hurry to get to Lecce the 10 am train might work better for you.
Trying to save money by sleeping in the airport is false economy—-not a good way to start your trip. You could end up fatigued for days.