No reason for it to be illegal.
The disadvantage of a flashlight would be way too narrow a light beam...not wide enough to see much of the road in front of you. The only advantage to using a flashlight as opposed to NO light at all is at least you'd be visible to on-coming traffic.