The TIME-WAIT state is required for two main reasons.
The first is to provide enough time to ensure that the ACK is received by the other device, and to retransmit it if it is lost.
The second is to provide a “buffering period” between the end of this connection and any subsequent ones. If not for this period, it is possible that packets from different connections could be mixed, creating confusion.
The standard specifies that the client should wait double a particular length of time called the maximum segment lifetime (MSL) before finishing the close of the connection.