I'll add my two pennies worth.
I've had quite a few CAT D vehicles over the years and generally bought direct from the insurance clearance auctions as damaged stock from people such as
www.copart.co.uk Like most have said above, as long as its been repaired properly I don't see the issue with them as long as photos were taken prior to repair. 9 times out of 10 the damage is totally superficial and there is nothing major to worry about. I bought a 2003 Range Rover Vogue TD6 a good few years ago classed as CAT D....it had been impounded by the police taken off a drug dealer....reason for CAT D....no keys and a lightly dented door skin. Cost me £300 to repair and was one of the best cars I had owned, it was immaculate and the door was repaired by a dent removal company.
Yes you will always struggle to sell them on if you don't have records of the damage and yes you will be hit with a much lower resale value BUT better the devil you know.
ON the flip side there are PLENTY of previously damaged cars on the road which aren't recorded and generally more of a death trap, for example my bro in law had a Peugeot 307 a few years ago, had a MAJOR shunt in it, airbags deployed, chassis leg damage etc but that was repaired by an 'insurance approved' bodyshop, drove like a pig when repaired
and I wouldn't have trusted the car with my family in it YET it was never recorded as a CAT D (really should have been a CAT C) but had a clear title because it was repaired.
To be fair I wouldn't buy a CAT D at the moment unless it was really really cheap though purely because of the re-sale hassle but when my finances were tighter in years gone by it was the means to an end and the chance to own a better car at a cheaper price.
In a nut shell - Cat D fine with recorded repair, Cat C - would always steer well clear.