“I train every day for many years for this competition so it is painful to have to pull out,” said the Frenchman. “I have to accept it. I prefer that it is here rather than at the Olympics.”
Mayer won the world championship in London in 2017 a year after claiming silver at the 2016 Rio Olympics.
He set the world record of 9,126 points last September at the Decastar meeting in Talence, southern France.
“I knew I was strong coming into Doha," Mayer added. "I was stronger than last year. I knew that I didn’t have to be at my best to be first … and we saw it.”
He had been tipped to win France's first gold of the championships.
On Wednesday, Pascal Martinot-Lagarde claimed the bronze in the men's 110 metres hurdles and Quentin Bigot won silver in the men's hammer throw.