He acted properly. When people are assaulting you with rocks — we're not talking pebbles here; we're talking brick- and softball-sized rocks — that's a very dangerous situation.Even if he was acting within the rules of engagement of the Border Patrol, as a matter of logic, it seems obvious that we shouldn't be instructing our Border Patrol agents to respond to rocks with gunfire. (I'm assuming he wasn't surrounded, a previous claim that was contradicted by a report from the Wall Street Journal. That would change the calculus a bit.) At the very least, a warning shot would be in order. The article linked above reports the Border Patrol claiming that "drug smugglers vent their frustration by hurling rocks at border agents", which may true, but seems more likely an attempt to conjure the biggest bad guy along the border as a way of impressing upon people that theirs is a dangerous and stressful job.
Also, Slate says that only three US policeman have ever been killed by rocks, and none in almost 70 years.