Why are non-essential passenger flights still being flown?
As discussed in this question airplanes carry a lot more than just passengers so shutting down passenger flights can stop the flow of essential supplies as well as people. In some cases charter flights are being used during this crisis but the general movement of people (even essential people) often relies on commercial flights. 

Similarly most states are issuing-shelter-in-place and stay-home-orders while it is only the federal government via the FAA that can totally shut down the airspace. Individual states, municipalities and private owners can shut down airports that they control but this may only stop flights in and out of those airports. 

Its worth noting that airports in other countries are starting to shut down. It is more than likely flights will be seriously curbed as a result.