The S&P 500, Dow Jones Industrial Average and Nasdaq Composite climbed to a trifecta of records Monday as stocks extended their postelection rally.

Investors have piled into banks, health-care stocks and industrials on bets that President-elect Donald Trump would loosen regulation and boost infrastructure spending. At the same time, they have pulled back from Treasurys and their stock-market proxies, which are less attractive to investors when interest rates rise.

On...