The legal history of this doctrine is, indeed, very murky. See this excellent paper, starting at page 4. You can download it at the link given and I've embedded it below the summary.
Property and the Public Trust Doctrine
The public trust doctrine is a little-known bit of legal history that is now touted as an ancient rule of law that allows governments to control property long presumed to be privately owned.
Eminent domain, or a regulatory taking that destroys all property value, requires compensation to be provided to the owner. The public trust doctrine avoids compensation by justifying a wide range of government controls. These mandates, in the name of environmental protection, may vary from allowing everyone the right to access some private property to preventing owners from using their property.
PERC Senior Fellow Randy Simmons explains the murky legal origins of the public trust doctrine and its recent expansion. Building on other PERC research by law professor James Huffman and economist Gary Libecap, Simmons lays out some of the practical political and economic consequences of the adoption of this doctrine. Some supporters, merely seeking added fishing holes to enjoy, may unwittingly support a policy that could seriously erode a key feature of American progress—the right to be secure in one’s property.
Download the full report, including endnotes and references.