If you can afford one thats straight take the straight option unless the Cat D is priced correctly.
TOO many people get a Cat D fix it and think its worth full straight car value.
I would want to see 20% price diff as a minimum for a Cat D for me to consider it.
That said if you throw modifications into the mix things can change.
Most importantly for you, above buying the car and damage that caused Cat D is the re sale.
What are your plans - keep it long term so the value is imaterial or fuck it off quickly.
Just think long and hard when you look at a Cat D.
To be honest though - if you have to ask what a Cat D is, my guess is you're not the sort of person who should really be buying one.