It is an understandable to assume that, when you entrust someone with your money, to hold and use only under certain conditions, and to return the money back to you when/if those conditions don't apply, the money are held by someone in trust for you (Dillon v. Cross (1907) 5 Cal.App. 766; Spencer v. Duncan (1895) 107 Cal. 423), or as a bailee (Niiya v. Goto (1960, Cal App 2d Dist) 181 Cal. App. 2d 682; CC § 1814).
Not so with the security deposits. The court in Korens v. R. W. Zukin Corp. (1989) 212 Cal.App.3d 1054, ruled that the money held by the landlords as security deposits create a debtor-creditor relationship, but are not held in trust, citing in support CC § 1950.5(d). (Id. at 1058-1059). Is the Korens Rule absolute? As it is with many legal concepts, the answer is "it depends."