They CAN fly.
However - domestication and breeding have created heavier bodies and smaller wings (breast meat is obviously the most popular) and thus they can't fly as well as some of their lesser domesticated counterparts (other fowl such as pheasant, quail, junglefowl, etc.)
Really - chicken (and other predominantly ground dwelling birds like turkeys) don't have a lot of flight ability to begin with. Their flight muscles are anaerobic as opposed to aerobic, so they're only capable of short bursts of activity rather than prolonged flying - which is also why breast meat is white, and the leg meat is dark.
Unless they absolutely have to get away QUICKLY, flying is just not energy efficient for them.
Everyone keeps pointing out they can't fly and why - but they can. It's not about why they "can't" fly - it's why they can't fly WELL.
And junglefowl are just as inhibited - just not nearly as much due to domestication.