a gravel bike is a good idea if you are dealing with less than perfect roads and if you are just getting started.
Road bikes don't flat often, but when you get flats, they seem to come in bunches.(not ideal when you are trying to get to work on time) A gravel bike isn't going to flat on the road, will be more versatile and about 60% as fast on the road as a road bike (quite a bit slower)
a gravel bike will be more reliable as your commuter, buy it to see how you like the whole situation, and if you are into it, sell it and buy a road bike, or keep both.
good luck.