In Sunday's games, Berdych lost to David Ferrer before Stepanek stunned Nicolas Almagro in the decisive rubber.
The Czech Republic lifted their first Davis Cup since gaining independence following a 1993 split with Slovakia.
The victory has handed the Czechs a rare team double after their women lifted the Fed Cup here two weeks ago -- a feat last achieved by the United States in 1990.
The former Czechoslovakia won the trophy in 1980 with a team led by then 20-year-old Ivan Lendl, who received the Davis Cup Award of Excellence before Sunday's rubbers.
As if inspired by Lendl, Stepanek, the world number 37, beat 11th-ranked Almagro 6-4, 7-6 (7/0), 3-6, 6-3 on the super-fast hardcourt of Prague's O2 Arena in front of a frantic crowd of more than 14,000 fans.
"It's amazing, we've written history here in our country," the 33-year-old Stepanek said before lifting the Davis Cup and singing the Czech anthem and 'We Are The Champions' with his teammates.
"There are no words to say. Undescribable. This is the best thing that can be," said his teammate Berdych.
The wild home crowd was all that Stepanek needed on Sunday to shake off the fatigue from Friday's singles and Saturday's doubles.
Combining patience with aggressivity and pulling off a series of winning volleys, Stepanek took the first two sets, the second in an impressive 7-0 tiebreak.
Almagro, 27, fought back in the third set, but Stepanek, red hot and propelled by the crowd, finished the job in just under four hours.
"I came on the court with a mindset that I have to stay calm, hungry, motivated, concentrated, and always know what I'm doing. And that's what I did," Stepanek said.
"I played very aggressive today, I didn't want to leave anything behind, I wanted to be the one who is active, who is controlling the game," he added.
Visibly upset, Almagro said he had tried his best but it simply was not enough.
"He was better than me and he's the winner," he said.
In Sunday's first match, Ferrer, the world number five, beat sixth-ranked Berdych in straight sets, 6-2, 6-3, 7-5.
The 27-year-old Berdych never quite caught up with his 30-year-old rival and admitted he was "way behind" throughout the rubber.
"I played very focused, very aggressive, I started really good and maybe that was the key," said Ferrer, praising his first serve and forehand.
"It's very difficult to beat Tomas in three sets but I played one of the best matches of my career in Davis Cup," he added.
On Friday, Ferrer beat Stepanek 6-3, 6-4, 6-4 and Berdych then put the Czechs level after beating Almagro 6-3, 3-6, 6-3, 6-7 (5/7), 6-3.
In Saturday's doubles rubber, Berdych and Stepanek beat Marcel Granollers and Marc Lopez 3-6, 7-5, 7-5, 6-3 for their 12th victory in Davis Cup doubles against a single loss.
Spain, who had won the Davis Cup three times in the past five years, were missing world number four Rafael Nadal, who is recovering from a knee injury.
They also won the Davis Cup in 2000 and 2004.
But Sunday left them struggling for words.
"We're sad at the moment. The Czechs were better than us," said Ferrer.
"The only thing we can do is congratulate them for the victory and we're ready to be here again," added Almagro.