Holding deposit is legal, the illegal part is to non-refundable part. Non-refundable deposit of any kind is essentially a "fee", which is illegal.
Landlord cannot just say you forfeit holding deposit if don't show up. If a tenant doesn't show up for lease and move in, landlord can use holding deposit for "actual damage". So you re-rented the unit out 10 days after the original lease date, you deduct 10 days of lost rent from the holding deposit and refund the rest. You deduct whatever actual lost rent from the holding deposit until it is used up.