Transaction B may depend on some prior transaction A which is not yet confirmed. Imagine a chain of unconfirmed transactions. Mempool has to track them all.