As for why unprivileged apps aren't allowed to use ICMP, the short answer is that normal apps have no legitimate use for ICMP traffic (which is mostly for error handling, some but not all of which is the sort that causes the OS to report various error codes) so, by principle of least privilege, they can't use it. This isn't actually a restriction about ICMP at all; there are several protocols available on top of IP (and more protocol numbers that could be standardized to mean various new transports). The expectation is that if a program is using IP, it's probably able to do anything it needs via TCP or UDP, so giving it access to anything else is unnecessary risk. The fact that Ping (and Traceroute) are thus impaired is an unfortunate historical fact.
An incomplete list of specific attacks that can occur if programs are able to use ICMP or other non-TCP, non-UDP protocols:
- ICMP is used for error reporting, and a malicious program could report nonexistent errors along particular network paths. This might cause other programs to be unable to reach their destination hosts, or even the entire machine to incorrectly think the network is down.
- ICMP can be used for various attacks on servers, such as ping floods, misdirection attacks (where the attacker sends a ping which lies about its origin, and the router or destination server sends the response to another IP, increasing the target's network congestion and load), and overly-large packets that recipients fail to handle, such as the classic "ping of death". Obviously anybody on the Internet could be sending those at any time, so Internet-facing services need to be prepared for them, but inside a controlled environment (e.g. a corporate LAN), you might expect that such attacks won't occur because you haven't given any untrusted users root privileges and don't allow untrusted devices on the network.
- ARP (Address Routing Protocol) is used to associate MAC (physical) addresses to IP addresses on a LAN. A malicious process able to spoof ARP traffic can convince other machines on the same LAN that it - rather than the router - is the network gateway (by e.g. telling them that 192.168.0.1 maps to their own MAC address) and convince the router that the other machines' IP addresses are all actually located on its own IP address. The attacker thus gains a "man in the middle" position for all Internet traffic that the target machines send or receive, enabling many attacks. While this is hard to prevent in environments where arbitrary machines can connect to the network (e.g. a coffee shop), it's another case where a secure network such as a corporate LAN might assume no malicious code has the privileges required.
- ARP spoofing can of course also be used to just block other machines off of the network, or prevent them from communicating with specific network peers.