I have no explanation of why it took so long to happen, but the Trump DOJ has finally filed suit against the State of California's various "sanctuary state" laws. In a nation (like ours) with no limits on internal relocation, control over immigration must be a federal responsibility. States cannot have idiosyncratic immigration policies.
I was, and remain, of the opinion that the Federal Government's right to enforce the supremacy of federal over state law was established by the Civil War. The Civil War established states cannot nullify federal law with their own laws, as for example South Carolina attempted at that time.
This case will eventually go to the Supreme Court which will, I predict, rule for the U.S. against CA. I suppose CA hopes the legal wrangling will take long enough for them to defy federal immigration officials for the rest of this presidential term. CA may be disappointed in that hope.