Ethiopian Lamecha Girma was left prone on the track after falling at a hurdle, the world record holder eventually stretchered off.
El Bakkali became the second man to successfully defend his Olympic steeplechase title after Volmari Iso-Hollo of Finland last achieved the feat at the 1936 Berlin Games, but said the year had "not been easy".
"I was suffering from an injury and I was able to overcome it," said El Bakkali, who was able to break Ethiopian team tactics with the help of his own teammate Mohamed Tindouft.
"The race was not easy. There was an Ethiopian plan, and thank God my compatriot Tindouft helped me. I asked him during the race to do anything to help me, so he pushed himself towards the front and raised the pace to break the Ethiopian block."
El Bakkali admitted that his injury woes had even left him thinking he might not participate in Paris.
"Forgive me, I now understand what I did," he said, in tears after the race.
"I entered history with this second consecutive Olympic title, and I owe it to the Moroccan fans who did not stop supporting me with their messages that I was unable to respond to, and to the current and former champions."
The 28-year-old El Bakkali arrived at the Olympics with a target on his back, having won the last three global championships.
After first triumphing at the Covid-delayed Tokyo Olympics in 2021, when he became the first non-Kenyan runner to win the Olympic steeplechase title since 1980, he confirmed his status with back-to-back victories in world championships in Eugene and Budapest.
His second Olympic gold in the French capital leaves him in rare company among Arab athletes to have doubled up at the Summer Games.
Only his Moroccan compatriot Hicham El Guerrouj, who won 1500m and 5,000m gold in Athens 2004, and Tunisian swimmer Oussama Mellouli (1500m freestyle in Beijing 2008 and 10km marathon in London 2012) have achieved the feat.
While El Bakkali sped away for victory, there was concern for Girma, the world record holder who fell badly on the third-last barrier.
Girma clipped the hurdle with his knee and plunged head first into the track. He was left prone and motionless, before receiving medical treatment.
He eventually left the track on a stretcher with his neck secured by a brace.