In a court of law, the DA has no clout as far as issuing demands, obliviously he made a request to the Court & the Judge ordered the No Contact order....a Judge can pretty much do what he wants & a No Contact order can be issued against any two people if the law supports it. A parent can be ordered to have no contact with their own children if it's in the best interest of the children.
A no-contact order can only be issued by a judge; a prosecuting attorney or district attorney cannot issue one. S/he would have to apply to the court, after which the court can issue or deny it depending on the arguments presented by the prosecution. Talk to an attorney for legal advice.