It you want a flat bar bike then you need to think about hand position. With a flat bar bike, there is basically only one way to hold your hands on the bars. Your hands/wrists will fatigue and you can't really reposition them. This is even more important as a beginner because you haven't built up a tolerance to riding much. However with a drop handlebar bike, you can hold your hands on the drops, on the hoods, and back at the stem on the tops. Furthermore, you can grab at slightly different angles in each position. This is very important in keeping you comfortable on the bike and thus want to get out and ride more.
I bought bar end extenders for my mountain bike just for the ability to be able to reposition my hands. If you want to be able to handle more off road or gravel, then there are also cyclocross bikes and gravel bikes to choose from.