I think back in those insane dotcom bubble days valuation and stock prices did not play well together. The acquisition moved forward because it was sound business (Yahoo's planned to become a media corp) and increased shareholder value, as the best way to profit from an overheated market was to hoard investors attention relentlessly.
If the company knew thought its stock was 10x overvalued (Yahoo's stock did drop 90% a year or so later) then they really only sold it for $570 million. That is, if Yahoo knew its stock would be worth 1/10 of its current value in a year, buying a company with $5.7B in stock will add value to Yahoo so long as The acquired company ends up being worth >$570M.
That being said, if they knew their stock was overvalued, it would be best to issue additonal shares, as $1 is worth $1 regardless. Similiar to how undervalued companies should buy back their stock.