Generally speaking, you should be fine to sleep with your dog while he has tapeworms. The chances of spreading the worms in that context are highly unlikely.