This does bring up an interesting question though. You say you made your determination by comparing the cost/benefit. Where and how does rights weigh into it? A parent has some level of right to determine how a child is raised. When does that right become null and void in defense of the child?
Well, while it would be nice to live in a world where we all had the right not to be hurt, that's not the world we live in. We live in a world where some level of hurt crosses a boundary and become criminal. A wife can cheat on her husband and hurt him tremendously but that's not criminal. That husband can beat his wife and his act is criminal and society will step in and try to address, punish, him.
The same applies with children - parents can be awful to their children but being an awful parent is not a crime. Physical brutality, of a level which a court decides is too severe, is a crime and the child must be protected from harm when that threshold is crossed.
So there clearly exist some boundaries between a parent's right to raise his child, even in an awful manner, and the child's right to safety or life. There doesn't exist a right to a better life or better home life that stands alone.
Physical punishment of a child, your #2 scenario, breaks down on philosophical grounds - some people believe in corporal punishment and others don't. Because we haven't crossed the line into threat of life or threat of permanent harm (punishing your child by burning their skin with an iron) the State has no business in picking one side of that argument and acting by removing the child. This principle is what I see when I look at the inter-racial marriage decision, Loving vs. Virginia. There have existed two forms of marriage throughout history - ingroup and outgroup - and the State chose one form and decided to prohibit the other form. It's not the State's business to pick favorites between two viable philosophies. Same with corporal punishment. There is a case to be made for and against. There are people deeply committed to each side.
Drug dealing parents. Again, not an ideal situation. Certainly poses a risk for the child due to violence which often accompanies this practice. Risk of violence though is not the same as certainty of violence. To remove the child here means that the State is acting on a probability. Maybe there is a case to be made here but I don't know the likelihood of a drive-by shooting for a drug-dealer's house. Does that happen to 99% of drug dealers? If it does, then the case for removing the child from a shooting zone is strong. I don't believe it is very common, but I could be wrong. Now we're left to contend with the fact that criminality is taking place in the house. Is that a sufficient reason to remove the child? When parents cheat on their income taxes, they're being criminals, but does that warrant a removal order? What goes on with drug deals is, at heart, a commercial transaction, but one which can't rely on police and courts to settle disputes, so those disputes are settled with violence. So the issue seems to be risk of violence and exposing children to witnessing it and possibly being harmed by the violence. Are children of drug dealers regularly killed in cross fire? I don't know. I'm presuming that the incidence of children being killed is very low. If this is true, then the simple presence of threat doesn't seem a sufficient reason to disrupt a family.
Drug use by parents. Lots of people have had to deal with this plus alcohol use and they survived. Certainly it's not ideal, but again, we're talking about using the awesome power of the State to destroy a family, so we should be using a high threshold for child removal orders and I can't see drug use by parents crossing that threshold.
Life threatening condition. As I explained above, I personally found this one pretty thought provoking. Parents can have a philosophy of life (say religion) and act on that philosophy in their own lives and bear the consequences and reap the benefits which follow. On what basis do we deny them the right to extend that philosophy to their children? I'm assuming that the parents in such scenarios are good parents, unlike the other situations, and this issue is one of conviction. The issue becomes who do we trust to have the "best" position - the parents or the physicians? I'm not aware of physicians having veto rights on all parental decisions, or more narrowly, on all parental medical decisions for their children. Now we're dealing with an even narrower issue - veto rights over life-death decisions for the child. Society entrusts parents with the care of their children. This sometimes means very hard decisions must be made. We don't give veto rights to physicians but now this seems to be a case where just that is being asked. Other than the child, who has most at stake? I'd say the parents. Who cares the most? Again, the parents. Who is best informed about the philosophy of the family? Again the parents. Who is best informed about medicine? The physicians. In an organization, the physicians would be staff advisers and the parents would be line managers. The buck stops with the parent. People have the right to refuse medical treatment. We allow parents to exercise that right for their children even if we, and physicians, disagree with the outcomes. Unlike #1 where the parents are likely to kill the child through direct action, #5 creates a situation where death isn't the goal being sought, the parents are praying for some form of salvation or believe that a greater harm arises from treatment. That fact that some people don't believe in the power of prayer is immaterial, the parents obviously do and they have final say. This is the only just and workable way to run a society - parents know better than the State what is in the best interests of their children. Lastly, I think that this is actually the most important principle, these cases of withheld medical treatment in life/death scenarios are very rare and so we shouldn't be setting precedent which allows physicians to have veto power over parental decisions.
Scenario #8 - being left alone is, by itself, not a horrible outcome. It's irresponsible, but by itself it isn't a tragedy. What's horrible is when bad things happen. So again we're dealing with an issue of probabilities. Northern Light made this scenario a bit more specific. If the home environment is dangerous or extremely unsanitary then we're dealing with probabilities which have a very high chance of turning into tragedy and this is neglectful parenting. This isn't a case where parents are choosing from a few ways of raising their children with their best interests in mind. Maybe that's part of the litmus test. Being neglectful so that your children face a real danger is grounds for removal but neglectful behavior which results in low risk doesn't cross the threshold.
Scenario #9 I sidestepped with appeal to school lunches but if pushed I'd probably revert to the reasoning in #8 - dying from starvation is in a different category than sometimes going to bed hungry. I've seen some pretty awful things in Africa, including starving children. Taking a child away from its mother is a pretty drastic step - hungry children still depend on their mothers a lot and I can't imagine that a full belly is going to be a fair trade for having one's mother kicked out of one's life. The better solution is to provide food to the family and keep it intact.