No, it's not against the law, but it is not a good idea. At 8 years of age, your daughter should not be sleeping with her father. You might want to gently suggest to him that either she or he should sleep on the couch. You will also want to keep an eye on your daughter to see if there are any behavior changes that might indicate a problem. If you do see behavior changes or changes in the quality of her school work, get her to a therapist.
Is this a divorce situation or a child born out of wedlock? If it is a divorce situation, check your Judgment and Decree to see if there is anything in that document about sleeping arrangements. If it is a paternity case (a child born out of wedlock), if there has never been a court order giving the father some rights, he has no rights and you can withhold his parenting time until he makes the appropriate sleeping arrangements. You will not, of course, want to withhold them completely, but rather change the arrangements so that he doesn't have her overnight. You can't arbitrarily change his parenting time if there is a court order giving him specific rights.
I'm not necessarily suggesting that the father is intentionally doing something bad, but we don't know what we do in our sleep. Even if he is not intentionally doing something wrong, he could be reaching out in his sleep and making inappropriate contact with her.
Sign up to receive a 3-part series of useful information and advice about child custody law.