If you registration was expired by more than 6 months, the tow was legal (if performed by law enforcement) pursuant to CVC 22651(o) - and it applies to off street parking facilities such as shopping mall parking lots.
The payment of fees is simply that - a payment of fees. The paperwork you receive from the DMV at that time even indicates that it is a report of a deposit of fees and is NOT an operating permit (it's wrritten all over the paperwork).
The amount you have been asked to pay might be high, but it might also include a city or agency vehicle release fee. Around here, a one day (overnight) tow will cost about $280. What you pay for is the hook fee and the cost and daily expense of the storage. So long as the amount does not exceed the fee levels as set forth by the state and the local agency contract, they are valid.
CVC 22658(i) has some further info:
(i) (1) (A) A charge for towing or storage, or both, of a vehicle
under this section is excessive if the charge exceeds the greater of
(i) That which would have been charged for that towing or storage,
or both, made at the request of a law enforcement agency under an
agreement between a towing company and the law enforcement agency
that exercises primary jurisdiction in the city in which is located
the private property from which the vehicle was, or was attempted to
be, removed, or if the private property is not located within a city,
then the law enforcement agency that exercises primary jurisdiction
in the county in which the private property is located.
(ii) That which would have been charged for that towing or
storage, or both, under the rate approved for that towing operator by
the California Highway Patrol for the jurisdiction in which the
private property is located and from which the vehicle was, or was
attempted to be, removed.
(B) A towing operator shall make available for inspection and
copying his or her rate approved by the California Highway Patrol, if
any, with in 24 hours of a request without a warrant to law
enforcement, the Attorney General, district attorney, or city
(2) If a vehicle is released within 24 hours from the time the
vehicle is brought into the storage facility, regardless of the
calendar date, the storage charge shall be for only one day. Not more
than one day's storage charge may be required for a vehicle released
the same day that it is stored.
(3) If a request to release a vehicle is made and the appropriate
fees are tendered and documentation establishing that the person
requesting release is entitled to possession of the vehicle, or is
the owner's insurance representative, is presented within the initial
24 hours of storage, and the storage facility fails to comply with
the request to release the vehicle or is not open for business during
normal business hours, then only one day's storage charge may be
required to be paid until after the first business day. A business
day is any day in which the lienholder is open for business to the
public for at least eight hours. If a request is made more than 24
hours after the vehicle is placed in storage, charges may be imposed
on a full calendar day basis for each day, or part thereof, that the
vehicle is in storage.