Nadal is often tested by the 24th-ranked Gulbis but has yet to lose a match to the Latvian in seven played.
This match, which was delayed for two hours by rain, marked only the second time Nadal has beaten Gulbis in straight sets. The other time was also in Doha, in the 2011 quarterfinals.
Nadal is set to play German qualifier Peter Gojowczyk. The 162nd-ranked Gojowczyk defeated fellow German qualifier Dustin Brown 6-3, 3-6, 7-6 (5) to reach his first career tour semifinal.
Mayer defeated Victor Hanescu of Romania 6-4, 6-7 (8), 6-4, and Monfils took out Daniel Brands of Germany 6-2, 6-1.
Nadal finally broke Gulbis in the 11th game when the latter sent a drop shot wide. Nadal needed five set points to close out the first set in the next game.
Gulbis raced to 3-0 in the second set but couldn't hold on to the advantage. He had three points for 4-1 but ended up losing serve.
Nadal broke with a stunning backhand cross-court that creased the line in the seventh game to take a permanent lead. He closed the match with a breathtaking backhand volley winner.
"I'm happy to win against Ernests," Nadal said. "If you are not playing well it's very, very difficult. He's able to hit winners from every part on the court."
Before this week, Gojowczyk had only one ATP tour-level match win, at the 2013 U.S. Open.
Gojowczyk was serving for the match against Brown at 5-3, 40-30 in the third set but netted a forehand to drop his serve. From 5-5 in the tiebreaker, Gojowczyk won the final two points.
"I'm so happy to be in the semifinals, it's an unbelievably good feeling," Gojowczyk said. "2014 is beginning great for me."