Why is the IP layer aware of higher layers in the network stack?
An IP packet has a payload that must be passed to some other process. The IPv4 Protocol field (IPv6 Next Header field does the same thing) tells IP where to pass the payload of the IP packet.
The protocols in other layers have an equivalent type of field to know where to pass their payloads. For example, ethernet has the Ethertype field to tell it to which process (ARP, IPv4, IPX, IPV6, AppleTalk, etc.) to pass its payload, and transport protocols have addresses (ports) to tell them to which process to pass their payloads.
why is the IP layer aware of higher layers in the network stack?
Because IP is not the final destination of the packet payload. Each layer needs to know where to send its payload, but that does not mean that any layer really knows what is in the payload, or what the next layer actual is or does with the payload. As far as IP is concerned, it passes the packet payload to the process that registered with it at the protocol number, not that the payload is going to any specific transport protocol because IP knows nothing about transport protocols.