Why is the ICMP protocol considered to run at layer 3 on the Wikipedia page?
As others have noted, the models are just that, models. So not everything in the real world always fits neatly into the models. ICMP is one such area where people will sometimes debate on which layer (L3, L3.5, or L4) it exists.
Despite these debates, ICMP is generally considered a L3 or network protocol because it isn't a transport layer protocol and L3.5 isn't an actual layer. Specifically, ICMP only provides structured data in the IP packet; it doesn't add anything that is considered another layer of headers like a L4 protocl like TCP or UDP do.
Additionally, while ICMP does require IP to function, it is implemented as part of the IP protocol and only exists to communicate information about the network layer. For example, ping (Echo requests and Echo replies) only provide information about L3 reachability. They don't provide any information about any higher layer protocols.
Why is the ICMP protocol considered to run at layer 3 on the Wikipedia page (same layer as IP) when the ICMP protocol data is a payload of the IP packet?
Whether the payload of an IP packet is raw data or a higher layer protocol is irrelevant to IP (L3). Or another way to say that would be just because an IP packet has a payload doesn't mean the payload is sourced from a higher layer protocol.
The same applies to L2, there are many examples (STP, CDP, and so on) of L2 frames containing data that has nothing at all to do with a L3 or higher protocol (i.e. no IP headers, etc). Again, just because the frame has a payload doesn't mean the payload is sourced from a higher layer protocol.