Marquez's Repsol Honda team mate and compatriot Dani Pedrosa finished second, 1.466 seconds behind, with double world champion Jorge Lorenzo completing an all-Spanish podium with third for Yamaha.
Marquez, who now has 225 points to Pedrosa's 148, became the first rider since Italian Giacomo Agostini in 1970 to win the first nine races of a season. Agostini won the opening 10 races that year.
In an unusual start, 14 riders - including all the factory ones - lined up together at the pitlane exit after leaving it late and deciding to switch from wet tyres to slicks only on the warm-up lap.
That left Germany's Stefan Bradl, who had put on the dry weather tyres before the formation lap, alone on the front row of the grid and followed at some distance by a bunch of backmarkers.
Marquez, the 21-year-old who last year became the youngest ever MotoGP champion, had qualified on pole but had to fight through from 10th while Pedrosa emerged 13th.
The champion was back at the front after six laps, however, and then pulled away comfortably.
"The surface dried out very quickly. I saw on the grid that Bradl had gone with the slick tyre option and I really had my doubts, because the area around the back of the track was still wet," said Marquez.
"I finally decided to see what Dani and Valentino (Rossi) were going to do, as they are my main rivals in the Championship and if you get it wrong in these races, you can lose a lot of points. That's why I decided to copy their strategy."
The Spaniard, who also set the fastest lap of the race, has now won in Germany for the last five years - in 125cc in 2010, Moto2 in 2011 and 2012 and then the top category.
Italian Rossi finished fourth on the other works Yamaha.
1. Marc Marquez (Spain) Honda 41:47.664
2. Dani Pedrosa (Spain) Honda 41:49.130
3. Jorge Lorenzo (Spain) Yamaha 41:57.981
4. Valentino Rossi (Italy) Yamaha 42:06.858
5. Andrea Iannone (Italy) Ducati 42:11.173
6. Aleix Espargaro (Spain) Yamaha 42:15.473
7. Pol Espargaro (Spain) Yamaha 42:20.917
8. Andrea Dovizioso (Italy) Ducati 42:21.532
9. Alvaro Bautista (Spain) Honda 42:21.895
10. Cal Crutchlow (Britain) Ducati 42:22.340
11. Scott Redding (Britain) Honda 42:25.408
12. Hiroshi Aoyama (Japan) Honda 42:32.682
13. Karel Abraham (Czech Republic) Honda 42:32.841
14. Nicky Hayden (U.S.) Honda 42:34.340
15. Danilo Petrucci (Italy) ART 42:40.433
- Sports & Recreation
- Dani Pedrosa
- Giacomo Agostini
- Jorge Lorenzo
- Marc Marquez
- Stefan Bradl