Questions About caddyshack

Caddyshack ending confusion

My Google searches have failed me. Help me understand the end of "Caddyshack." I just saw "Caddyshack" again, it's been a while. But not being a golfer, the end is confusing me. Let's recap: The principals are playing a golf match. The referee (Brian Doyle-Murray) says "Gentlemen, this match is all even. Final hole. Doctor, you are away." Dr. Beeper (Dan Resin) putts and misses, and makes his second putt. Ty Webb (Chevy Chase) putts, misses, and makes his second putt. Judge Smails (Ted Knight) takes out the old "Billy Baroo" and makes his putt. Danny Noonan (Michael O'Keefe) putts, the ball hangs on the edge of the hole until the course blows up, then the ball falls in, and everyone rejoices because the good guys win. How is it they won? I don't know much about golf, but shouldn't this be a tie?