Djokovic had lost the first set in a tie-break and was down a break in the second when he withdrew from his quarter-final, with Berdych up 7-6 (7/2) 2-0.
Berdych will face 18-time grand slam champion Roger Federer for a place in the final on Sunday.
Djokovic said it was an elbow problem that forced him to abandon the match.
He said the elbow had been troubling him for 12 to 18 months, and that it had been hurting more intensely as Wimbledon progressed.
He said he would see a specialist to examine the injury.
“It’s unfortunate I have to finish the Wimbledon grand slam this way,” Djokovic said.
“I tried to get it in the condition where I was able to play.
“I was able for 30 minutes to play with pain that was bearable. The serve and forehand were the shots where I could feel it the most and after that there was really no sense (in continuing).”