Sometimes there is no perfect solution. The court also has to take practicality into consideration.
The welfare of the child is often best served by allocating custody such that a child can stay at one residence most of the time (with regular visitation to the other parent to maintain the relationship), so that the stability of the child's living situation is not disturbed by having to constantly switch between two residences, having their school routine and social life disrupted, etc.
Also, custody split is only part of the issue. Supposing parent A earns 2x parent B's income, they should still be paying child support even if custody is 50:50, so that the same standard is maintained across both households.