There originally was no limit to the number of clubs a player could carry. Early players (or their caddies) toted just three or four, which they tucked under their arms to carry. However, as the sport progressed, players began to carry a large variety of specialized clubs. Lawson Little won the US and British Amateurs with more than 30 clubs in his bag.
The USGA set 14 as the maximum in 1938. The R&A followed suit in 1939.
Caddies all over the world were grateful.
Under Rule 4-4, the penalty for carrying more than 14 clubs is two strokes for each hole played at the point at which the breach was discovered, with a maximum of four strokes per round.
Note that players are not required to carry 14 clubs. I know several players who carry only a half set: the even irons, or the odd. There also are no restrictions as to the makeup of that 14 club mix. If you want to carry two drivers, or two putters, or seven wedges, all of that is fine, so long as the 14 club limit is met.