A malfunctioning sprinkler head caused extensive water damage in downtown Suffolk, displacing about 50 residents.