The ABX index shows the changes in the price of the derivatives, which are as a result of defaults and subsequent decrease in demand in the housing market.
Now the market value will be based on what the market is ready to pay looking at all the risks (default risk, liquidity risk) and also the kind of returns they would receive on such loans, so computer models according to market participants were unable to judge the sentiment and so the investment banks had to write down their investments.
You mentioned the rule that banks generally value their loans by the book value. This implies only until the credit rating agencies maintain the initial credit rating on these securities.
As soon as they downgrade the ratings of these securities, investment banks can either hope for a while that the market condition reverses and their is sudden demand for their debt inventory (which was piled up because of the liquidity crisis) or they have to write down the value of their debt which they hold because investors will not be willing to pay the same amount of money for the same debt with downgraded rating.
The downgraded rating (by credit rating agencies) of this kind of debt was obviously due to the defaults in the sector and fall in demand for houses.
The lag in value of these securities was probably due to the computer models, which were used by investment banks, which varied from banks to banks to value them.
Now another reason for an increase in the write downs by investment banks is cited as an increasing no of banks have moved to a more market based approach in valuing these securities (using ABX index) in the fear that they might be prosecuted on the wrongly guiding their investors (the "ENRON" factor).