The welfare rolls lose the mother (since she can now work, or at least go to school and become productive later on: and if she has the intelligence to give up a child for which she cannot care, she probably has the motivation to do so). Government programs hate to lose clientele, because it could reduce their budget and influence. Statists like people to be dependent, because they will vote for more theft to feed their addiction to Other People's Money. If someone joins the civil society as a productive member, they will not look kindly upon redistributionist theft of what they worked to earn.
Other welfare departments lose the child, or child benefits, from their rolls. Their influence, power, and budget also takes a hit.
The child will go into foster care or likely a state-run orphanage; if the child from there is adopted into a family that can care for him, the foster care system will also lose power and prestige: if they stay in the system, the department and the state will be able to justify taking more from the people.
Since having a single parent is the largest predictor of juvenile delinquency, crime, and other failures in life (including ending up on welfare), adoption to a stable home breaks the cycle of dependency. (And given this fact, it is not heroic for a single mother to keep the child: it is in fact cruel.)