Some medications affect the body's natural ability to deal with the sun's ultra-violet rays which can cause skin damage, eye damage, immune system problems, etc. There are lots of medications that have this warning.
It's not that if you walk outside that you'll be killed by the sunlight. It's a situation where the meds CAN cause problems so the drug manufacturers are protecting themselves from law suits for not warning patients of the risk with the their medicines. God bless.