DETROIT—General Motors Co. officials were red-faced on Wednesday after software on a network at its headquarters was programmed to insert a derogatory remark on computer browsers after any mention of Chrysler Group LLC and several other competitors.

The prank came to light at GM's unveiling of a battery-powered version of its Chevrolet Spark small car at a five-day event marking the 100th anniversary of GM's Chevrolet brand. The event drew more than 200 journalists from around the world.

Selim...