I believe that these laws date from after the Civil War when the Klan and other unreconciled Southerners carried out numerous attacks on federal officials and employees.
It’s important to note that these charges simply reflect the jurisdictional difference between federal employees and others. He will later be charged by the state for murder and attempted murder, it’s just going to be split that way to ensure conviction in one of the venues. They could have charged him federally for all the crimes, but splitting it up gives them virtual certainty of conviction on a murder charge.