The S&P 500 closed at a record high, but fewer than half its stocks ended above their 200-day moving average, signaling narrow market breadth that investors should watch closely.