Both of those functions consume a large amount of energy. The phone's processor and other components require a minimum amount of energy to remain stable. The battery can only output so much at a time. The phone is not letting you use both simultaneously time to avoid a "brown-out" and potential crash or other failure (perhaps it is unsafe for the battery as well, overheating is dangerous). Many phones also restrict the use of the flash when battery power is very low.
If you use a third party flashlight app, you may be able to bypass the restriction. I know I can, however my phone is also rooted which makes everything easier.