Yes, it is legal. Remember: it is not actually required for employers to provide health insurance to employees, and if they do, can put limitations or restrictions on it, such as that they will only cover members of the employee's household. A child is generally considered part of the household of the parent who claims her on their taxes; therefore, the employer could consider your daughter not part of your ex-husband's household and so not someone they have to cover.