Q:

Do mortgage lenders ever prefer bad credit?

In the US,  If you want to put $400,000 down and  borrow $100,000 with a mortgage  to buy a $500,000 home, is it really so important to have good credit with so much collateral?  If you were to default the bank will get all that equity so it seems to my uninformed mind  that banks might desire you to have bad credit in such a situation as above were %80 of the house is already put down.

A:

is it really so important to have good credit with so much collateral

Yes it is important to have good credit, the bank may not lend or may charge higher for bad credit.

If you were to default the bank will get all that equity so

You are missing the fundamental. Bank cannot take more than what they are owed. When they take possession of house, they auction it. Take what was due from the sale and return any surplus to the owner. This entire process takes time and hence bank wants to avoid giving loan to someone who they feel is risky.
Edit:
There are different aspects of risk that the bank factors. 

Whether someone will default on repayments. This is established by income and credit score. Based on this they would assign low, moderate, high risk.
In case of a default, will the Bank lose money. This is determined by the equity in the house. The more equity, the more the Bank is safeguarded that even in adverse conditions, the Bank will not lose money. The only advantage with your example is the bank may not lose money even if price crashes by more than 50%.

