I'm no expert on DACA nor illegal immigration, so maybe someone can explain better, but in a nutshell: in the 80s, Plyler v. Doe was decided that states cannot discriminate against illegal children attending public school because one, children rarely, if ever, have any choice in their migration to the the US, so imposing rules against them attending public schools and receiving an education would be cruel and unfair, and two, would that discrimination would result in, quote, "the creation and perpetuation of a subclass of illiterates within our boundaries, surely adding to the problems and costs of unemployment, welfare, and crime.".
Basically you have much much more to lose than to gain by imposing restrictions on illegal children's ability to receive a basic public education. Is there a cost? Sure. But you aren't going to feasibly, literally stop all illegal children from coming into the US, and the cost of these children growing up to illiterate, uneducated, and as a result, likely criminal adults would be much greater. DACA in a way is a logical extension of the Plyler v. Doe case, which allows children who were brought here illegally (again, likely with no choice in the matter) to become quasi-contributing members of society. They aren't fully legal and this doesn't provide them a path to citizenship mind you, but it allows them to be educated, to work, pay taxes, and most importantly, not have to constantly live in fear that they are going to be deported back to a country they have basically never known.