Media playback is not supported on this device
The 33-year-old Swiss announced he was "not match-fit" as he apologised in person to the crowd at the O2 Arena.
Federer beat Stan Wawrinka 4-6 7-5 7-6 (8-6) on Saturday in a thrilling semi-final lasting two hours and 48 minutes.
It is Djokovic's fourth victory at the season-ending event and he also becomes the first man to win three titles on the trot since Ivan Lendl in the 1980s.
Federer - who has won the tournament six times - confirmed his withdrawal following the doubles final on Sunday afternoon, won by American brothers Bob and Mike Bryan.
"I'm sorry I'm not fit to play," he said. "I hope you understand. I wanted to come out personally and explain.
"I did everything I could. I took pain-killers, had rest until the very end, but I just cannot compete at this level with Novak.
"At my age it would've been a risk.
"It's not that much of a surprise. This back spasm, whatever it might be, it's just not a fun thing to have during the day. It's just uncomfortable. But I'm positive and I'm hopeful that it's going to go away soon."
Tournament organisers arranged two exhibition matches to take the place of the final.
Djokovic defeated Andy Murray 8-5 in a pro set in the first match and the British number one then paired up with John McEnroe to beat Tim Henman and Pat Cash 8-6 in a doubles contest.
Djokovic, 27, who finished the year with only eight defeats from 66 matches, collected the ATP World Tour Finals trophy before his exhibition with the Briton.
"It's clearly not the way I wanted," he said. "It's an incredible achievement, but at this moment it's hard to talk about it. I'm not one of the players that celebrate this particular type of win.
"I have to reflect on the whole season and this trophy is the crowning moment for the efforts this year. I'm very happy to be able to stand here and finish off with a trophy."
Federer is scheduled to join Switzerland team-mate Wawrinka for the Davis Cup final against France next week and said his immediate plan was for "recovery" and then "travelling to France and getting ready for the clay".
He suffered with a back problem in 2013, and there were signs in the closing moments against Wawrinka that he was struggling again.
Federer did not complete his post-match media duties until after 01:00 GMT on Sunday, and missed his scheduled practice session at O2 Arena in the afternoon.
Media playback is not supported on this device

The girls ate othalanga, a local fruit, at the Water Sports Centre in southern Kerala state, reports said.
The girls, all rowers, were allegedly being harassed by senior athletes and their trainer, their families allege.
The government-run Sports Authority of India which runs the centre has ordered an inquiry into the incident.
"They had left behind a suicide note. The jurisdictional magistrate has also recorded the statement of one of them. The police investigation is also on," SAI (Sports Authority of India) director general Injeti Srinivas told reporters in Delhi.
SAI official G Kishore, who has been asked to conduct the inquiry, told BBC Hindi's Imran Qureshi that the condition of one of the girls admitted to hospital was critical while the other two were out of danger.
The athletes were taken to hospital on Wednesday evening after they were found unconscious in a room of their hostel.

The Irishman, who turns 21 on Saturday, will remain at Craven Cottage until the summer of 2018.
Kavanagh, who can also play at left-back, has made a total of 11 appearances since his debut for the west London club last August.
He scored his first goal for the Whites in the 1-0 win at home to Norwich City in October.
Roger Federer has withdrawn from the ATP World Tour final against Novak Djokovic because of a back injury.
[NEXT_CONCEPT]
A 15-year-old Indian athlete has died and three others are in hospital after allegedly consuming poisonous fruit in what is suspected to be a suicide pact.
[NEXT_CONCEPT]
Fulham midfielder Sean Kavanagh has signed a new contract with the Championship club.