There are a few things you can do to keep spiders out of your bed:
Make sure your bed is properly sealed.
Stay away from areas with lots of spiders.
Use a bug spray that contains spider repellent around your bed.
Keep your bedroom clean and free of clutter.
Vacuum regularly.