The Spaniard will move up one spot in the world rankings to number three after he closed with a 4-under 68 to win by one stroke on Sunday at La Quinta.
Rahm and 23-year-old Thompson were tied with three holes to play when Thompson, who led through 36 holes and shared the lead with Rahm going into Sunday, pulled his drive into a deep fairway bunker on the par-five 16th and wound up with par. Rahm made birdie to take the lead.
On the par-3 17th, the American chose to leave the pin in for his 50-foot birdie putt on the island green, and the ball squarely hit the pin and rolled away.
The Georgia native showed visible frustration as he walked to the 18th tee after tapping in for par.
Rahm finished 27-under 261 and won for the ninth time on the PGA Tour.
The Spaniard has also now has won four of his last six starts - he won twice on the European tour at end of last year.
"The turning point was 16," Rahm said. "He missed that tee shot and I put it in the fairway. That's pretty much a half-stroke penalty right there.
"I knew if I did what I could do I was mostly likely going to have a one-shot lead going to the last two holes."
Thompson said: "I usually always leave the stick in from a long distance. I feel like it helps me with my speed. I'll probably play the 'what if' game in my head for a long time, unfortunately."
Scottie Scheffler closed with a 67 and tied for 11th. He narrowly missed a birdie putt on the final hole that would have allowed him to return to number one by a fraction of a point over Northern Irishman Rory McIlroy.
The Briton and current world number one will make his 2023 debut in Dubai on the European tour next week.