Being a uniformed policemen requires few conventional job skills. You certainly don’t require qualifications or experience; the main thing you need is a limited degree of physical fitness.
Given the meagre entrance requirements, policemen are paid notably more than their talents would earn them in any alternative job open to people with the same level of qualification and experience, such as toilet cleaner or roadsweeper. Presumably the reason for this is that policemen are at a moderately greater risk of personal violence than a toilet cleaner or roadsweeper.
If we were morally coherent, then, we’d view a policeman who was shot as no more heroic than a labourer who died in an industrial accident: both people died doing moderately dangerous jobs, because they were willing to trade increased personal risk for slightly higher pay than the minimum wage. The most notable difference between the two situations is that what builders do is unequivocally useful.
So why do we regard people who assault or kill cops as *worse* than people who assualt and kill members of the public?