As usual, the answer is almost certainly somewhere closer to "Rule of Cool" than anything else, though I believe there is some real-world precedent to using that sort of rifle to shoot soft targets.
Chances are good you'll see one or two .50 caliber rifles similar to that one at your average gun and knife show in the midwestern U.S., and I actually thought about buying one until I realized that:
- even out in the country I had no place to practically shoot such a monster,
- shooting it would loose its novelty after the painful recoil of the first shot,
- the ammunition is ridiculously expensive,
- the rifle and ammo are ludicrously heavy and wouldn't be fun to take to any range that could handle them,
- I can't even make up a good almost-realistic-sounding excuse to own one.
I consider myself fairly practical about stuff like that, so if even I seriously considered it for a moment, then I guess it goes to show that nothing exceeds like excess. Why were the soldiers using a .50 caliber anti-materiel rifle to swat flies? Perhaps because there was nothing stopping them.
In-universe, there's another possible explanation: I think "The Walking Dead" revealed that EVERYONE is infected with whatever causes them to become "walkers", and the series in general has hinted (sometimes more, sometimes less subtly) that the infection has had some effects on the characters' reasoning. If there's a more violent/suicidal, irrational, and over-the-top option that the characters can take, they generally take it.
All that said, that specific episode of the show is playing around a bit with the contrast between what the civilian character wanted to believe about the military (that they were competent, in control, and going to protect everyone and fix everything and all he had to do was get behind the fence and stay out of their way) and the reality of the situation: the soldiers involved were pushed close to their breaking point, their morale was hitting rock bottom, their discipline was falling apart, their chain of command had begun to break down, and they were on their own, making bad decisions, close to mutiny, testing the limits of how much freedom they had to abuse their authority, and waiting for an excuse to bail out of a situation that had long ago "gone pear-shaped".
A scene in which these soldiers are trying to get a pacifist civilian leader to pull the trigger on their ridiculously excessive force has a symbolic touch to it that will probably give that scene some context from a storytelling point of view. I think this, combined with the Rule of Cool, is probably the real explanation for why the scene was framed the way it was.