Not exaclty, but close
When a lender forecloses, they are somewhat bound to write the property value to ZERO (it's called mark to market).
The lender is then able to show tremendous losses on paper, and potentially look to the Federal Gov. for help.
Meanwhile the banks REO dept. markets and sells the property, which obviously has much more than a Zero value, and that is pure profit...
The upside for the bank is much bigger with a foreclosure than a short sale.