It has to be illegal on some level to check into an hotel under an alias/assumed name. However, most hotels will not look too closely at anything unless you give them reason to do so. Generally, as long as the bill is getting paid hotels prefer not to meddle in the affairs of guests.
Cash is usually the preferred anonymous payment method.