Don't confuse the network layers. Each layer has a specific purpose. Also, don't assume that there is only one protocol for each layer. Layer-2 has many protocols, some of which use MAC addresses, and some which don't. Of those that use MAC addresses, some use 48-bit MAC addresses, and some use 64-bit MAC addresses. There are also multiple layer-3 protocols. IPv4, the most used, but not the only, layer-3 protocol, uses 32-bit addresses, but it is being replaced with IPv6, which uses 128-bit addresses. You don't want to replace or upgrade all your layer-2 devices each time you want to run a different layer-3 protocol.
MAC addresses are layer-2 addresses, and they are used to deliver layer-2 frames on a LAN. Switches are layer-2 devices, and they use MAC addresses to create a table of which host is connected to which switch interface. A switch will look at the source MAC address to build its MAC address table, and it will look at the destination MAC address, look it up in its MAC address table, and deliver the frame to the correct port. Absent a destination address in its MAC address table, the switch needs to flood the frame our every other interface, and that is pretty inefficient and wasteful of bandwidth on all the other interfaces. Switches do not look inside the frame to inspect the IP address. This allows layer-2 and switches to carry any layer-3 protocol (IPv4, IPX, IPv6, etc.).
IP addresses are layer-3 addresses, and they are only looked at by layer-3 devices, e.g. routers. A router receiving a layer-2 frame will strip the frame from the layer-3 packet, and it will look up the IP address in its routing table to see to which interface the packet should be switched. The router will build a new layer-2 frame for the new LAN connected to the destination interface.
Layer-2 (MAC address, etc.) is for devices connected to the same layer-2 domain, and layer-3 (IP address, etc.) allows you to send data to other layer-2 domains.