Sending ICMP traffic requires a raw socket which needs root to open. To that end, the ping command is normally installed suid root, though these days there are ways to selectively give programs extended privileges like that. Sometimes people do system hardening which removes the setuid bit on ping, requiring sudo to make it work.