Danny Noonan (Michael O'Keefe) is an underacheving 17-year-old guy who works as a caddy at the upscale Bushwood Country Club in Beverly Hills to earn enough money to go to college. Danny often caddies for Ty Webb (Chevy Chase), a suave and talented golfer and the son of one of Bushwood's co-founders. Danny decides to gain favor with Judge Elihu Smails (Ted Knight), the country club's stodgy co-founder and director of the caddy scholarship program, by caddying for him.
Meanwhile, Carl Spackler (Bill Murray), one of the dim-witted greenskeepers, is entrusted with combating a potentially disastrous gopher infestation. Throughout the film, he tries a variety of methods to kill the gopher (e.g. shooting, drowning) without success.
Al Czervik (Rodney Dangerfield), a brash and obnoxious nouveau riche real estate developer, begins appearing at the club. Smails is heckled by Czervik as he tees off, causing his shot to go badly wrong. Smails throws a putter away in frustration and accidentally injures a member of the club. Danny takes responsibility for the incident, as a ploy to gain Smails' trust. Smails encourages him to apply for the caddy scholarship.
At Bushwood's annual Fourth of July banquet, Danny and his girlfriend Maggie (Sarah Holcomb) work as servers. Czervik continues to irritate Smails and the club members, while Danny becomes attracted to Lacey Underall (Cindy Morgan), Smails' promiscuous niece. Danny wins the Caddy Day golf tournament and the scholarship, earning him praise from Smails and an invitation to attend the christening ceremony for his boat. The boat is sunk at the event after a collision with Czervik's larger boat. On returning, Smails discovers Lacey and Danny having a tryst at his house. Expecting to be fired or to have the scholarship revoked, Danny is surprised when Smails only demands that he keeps the incident secret.
Unable to bear the continued presence of the crude-mannered Czervik, Smails confronts him and announces that Czervik will never be granted membership. Czervik counters by announcing that he would never consider being a member: he insults the place and is merely there to evaluate buying Bushwood and developing the land into condominiums. After a brief scuffle and exchange of insults, Ty Webb suggests they discuss a resolution over drinks. After Smails demands satisfaction, Czervik proposes a team golf match with Smails and his regular golfing partner Dr. Beeper (Dan Resin) against Czervik and Webb. Against club rules, they also agree to a $20,000 wager, quickly doubled to $40,000, on the outcome of the match. That evening, Webb practices for the game against Smails and meets Carl, where the two share a bottle of wine and a joint.
The golf match is held the following day. Word spreads of the stakes involved and a crowd builds. During the game, Smails and Beeper take the lead, while Czervik, to his dismay, is "playing the worst game of his life". He reacts to Smails' taunts by impulsively redoubling the wager to $80,000 per team. When his own ricocheting ball strikes him, Czervik feigns injury in hopes of having the contest declared a draw. Lou, the course official who is acting as an umpire, tells Czervik his team will forfeit unless they find a substitute. When Webb chooses Danny, Smails threatens to revoke his scholarship, but Czervik promises Danny that he will make it "worth his while" if he wins. Danny eventually decides he would rather humiliate the selfish, conceited Smails than take the scholarship.
By the time they reach the final hole, the score is tied. At the climax of the game, with Danny about to attempt a difficult putt to win, Czervik again redoubles the wager to $160,000 per team. Danny's putt leaves the ball hanging over the edge of the hole. At that moment, Carl, in his latest attempt to kill the gopher, detonates a series of plastic explosives that he has rigged around the golf course. The explosion shakes the ground and causes the ball to drop into the hole, handing Danny, Webb, and Czervik the victory. Smails refuses to pay, so Czervik beckons two hulking men, named Moose and Roco, to "help the judge find his checkbook." As Smails is chased around the course, Czervik leads another wild party attended by all of the onlookers at the match, shouting, "Hey everybody! We're all gonna get laid!"
In the final scene, the gopher emerges, unharmed, and dances amid the smoldering ruins of the golf course.