They don’t have to; they choose to.
You can argue that this is a reasonable choice to make, but I wonder: what percentage of people stopped by police are actually armed in reality? What percentage of those people represent a real threat to the police?
Statistically, American policing is not a dangerous job. It’s much safer than just about any traditional blue-collar work; construction, forestry, mining, nursing, etc.
Would it really become unacceptably dangerous if police weren’t encouraged to routinely threaten to murder people?