A persistent shortage of construction workers across the U.S. is prompting some of the nation’s largest home builders to experiment with a model they once derided: factory production.

KB Home last month unveiled a model home equipped with an energy-efficient kitchen and a rotating audiovisual wall that serves either as a television or video-conferencing system for two adjoining rooms. The high-end, high-tech components all were built in a manufacturing plant and meant to be assembled at the home site, requiring far fewer workers...