Legal, yes. A good idea, probably not.
If you are truly concerned, have your divorce attorney file a motion to address the sleeping arrangements, or buy her an air mattress. Buying the air mattress will be a lot cheaper.
Not illegal. If this is a serious concern for your daughter's emotional well being etc., consult your attorney to try to modify specifics of visitation etc.
BEST ANSWER I got.... and I HOPE I WAS HELPFUL!! Steve Hamer answers questions on Avvo for general information and not as legal advice. Those answers do not establish an attorney/client relationship. If you would like my help, contact Mr. Hamer at (214) 843-1529 for a FREE CONSULTATION.