Why EC2 instance continues responding to a ping request after deleting the inbound security group rule?

The change applies immediately, but security group rules control establisment of new traffic flows (identified by source and destination address, protocol, and port numbers for protocols that use port numbers).

Depending on the specific rule in question, flows may or may not be actively tracked by the network, but ICMP flows are always tracked. Once a tracked flow is established, the flow no longer needs to match a rule because the network has created a state table entry for the flow that will persist until the network removes it, either due to an inactivity timeout or due to a close/reset for connection-oriented protocols like TCP.

Tracked flows are not disrupted by removal of the rule that allowed them to be created.

Stop the ping and restart it. If it continues to work, stop it and wait a few seconds before restarting it. You should find that shortly after removing the rule, a new attempt to ping the target instance results in a timeout.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html#security-group-connection-tracking