The minimum length of the data part of a TCP segment is zero. The minimum length of the data part of a UDP datagram is zero.
If an IP stack needs to pass a less-than-46-byte datagram to Ethernet, Ethernet pads it out to 46 bytes by adding padding bytes. The IP header has its own length field (as do the TCP and UDP headers), so those protocols never get confused and try to interpret the link-layer padding as part of their own payloads.
Ethernet is just one of many, many data link layer protocols IP can run on. Ethernet has a 64 byte minimum packet length for legacy technical reasons (so that "collisions" could be reliably detected on max-diameter Ethernet networks, back when Ethernet networks were CSMA/CD and could have collisions — modern Ethernet networks use switches everywhere and are full-duplex on all segments, so CSMA/CD and collisions are pretty much a thing of the past).
Because we so often use IP over Ethernet, it's easy to forget that Ethernet and IP are two separate network technologies created by two separate institutions. Ethernet, standardized by the IEEE (Institute of Electrical and Electronics Engineers) was designed to handle an unknown number of Network (layer 3) protocols besides IP, and IP, created by the IETF (Internet Engineering Task Force) was designed to work on an unknown number of Data Link (layer 2) protocols besides Ethernet. IP does not change its minimum or its maximum datagram size just because of one popular link-layer protocol. If the link layer protocol doesn't like a tiny datagram it gets, it has to pad it. And in the opposite case, if IP doesn't like the MTU the current data link offers, it has to fragment.