It's a longstanding norm that presidential candidates get secret service protection. Even Trump got protection starting in 2015. I'm not a particular fan of either of the two, but it hits especially hard for RFK, the candidate who's father and uncle died under suspicious circumstances.
In Biden's defense all the secret service agents are injured.