As cruel as it is, technically speaking, giving the baby to the first queen is the right move. Berta was only sent to the palace to give the king an heir after all. In order for the child to become the king's official successor, it is necessary that the first queen raises him. Otherwise, he'll be nothing more than a bastard.