The lawsuit was filed in the court for the Northern District of California.
It comes days after Mr Trump invoked emergency powers to bypass Congress and secure funding for the project – a key campaign pledge.
Democrats have vowed to contest it “using every remedy available”.
California Attorney General Xavier Becerra said they were taking President Trump to court “to block his misuse of presidential power”.
“We’re suing President Trump to stop him from unilaterally robbing taxpayer funds lawfully set aside by Congress for the people of our states. For most of us, the office of the presidency is not a place for theatre,” he added.
The lawsuit filed on Monday seeks a preliminary injunction that would stop Mr Trump acting on his emergency declaration while a legal battle takes place in the courts, the Washington Post reported.