The health care sector remains underowned despite improving fundamentals, raising the possibility that June marked the beginning—not the end—of a broader rotation.

Stocks in the healthcare sector pull back amid quarter-end portfolio rebalancing and as investors rotate back to tech names.

Health-care companies rose as traders continued to rotate out of high-risk artificial-intelligence stocks into lagging sectors.