I frankly think that being under the gun to depart on time flight after flight, day after day, wears on them. Maybe they should screen folks better for attitude before selecting them for that position, but if every day you were under the gun to get the flight out on time, without exception, and if you were often there by yourself or with only one other agent, it might not be the stress of any individual transaction, but the cumulative effect of thousands of transactions that just wears you down. Hence, the attitude.
I don't really like it, and I go out of my way to avoid interacting with gate agents because of it, but in a way I do empathize with them. It's not unlike the wear and tear on healthcare workers, where clinically excellent folks can become grumpy.