The Trump Administration did not separate families. The Immigration and Naturalization Service does, as part of prosecuting someone for criminal action. Nor did Trump specifically order this - INS was doing this during the Obama years, and Bush years, and Clinton years, and...
For that matter, children of US citizens who are arrested are put in some form of custody by the state or federal police that make the arrest, if both parents are under arrest (or if there is only one parent and they are arrested), and if no immediate relative can be found to take charge of the child. Since any parent or relative who is with a child at the time of an illegal border crossing will be arrested, that means that all children of arrested border crossers will be placed in some form of custody. The alternative would be to put the children in jail with the parents. Definitely Not Good.
What has changed recently is the Trump administration establishing a zero tolerance policy for illegal immigration... that all cases will be prosecuted. Previously, many people caught by INS were simply taken to the border and sent back across.
Trump's real error was in not considering all implications of the zero tolerance policy. That's one of the negative side effects of a president with very limited experience.
Then, there is the matter of why so many children are being brought along for an illegal border crossing, also a fairly recent change. That is the result of DACA, the 'dreamer act' put in place by the Obama administration, that promises more lenient action to illegal immigrants whose families are with them. Consequently, many people seeking to cross the border are now bringing their children with them in the hopes of getting that leniency, when previously children would almost never be subjected to the hazardous journey that people crossing the southern border experience... robbery, rape, and occasionally dying from being left in the desert, or suffocated while packed into a small space.
The combination of DACA, encouraging those people to bring their children along, with the new zero tolerance policy that requires arrest and prosecution of illegal border crossers (without considering all implications), is why so many children are being separated from their parents.