Restaurants? Definitely not illegal. Obviously if you don't make a reservation, they don't even know your name. You can show up and pay cash completely anonymously. And if you need reservations, there's nothing stopping you from setting up an Opentable account with a throwaway email address and fake information.
Hotels? Obviously varies by local laws. I'd generally say no for international travel, due to the fact that many countries require foreigners to register with their passports. For domestic U.S. travel, I'd suggest you can get away with it at certain places, although using a debit card always raises eyebrows and potential complications. I'd probably stick to motels and stay cash-based for this.
If there's no fraud or anything unscrupulous going on, why the need for secrecy?

I've already assumed that someone on top-secret government work wouldn't be on Flyertalk asking this question, and would already have the credentials needed to travel with an alias.