Traveling by car and staying in a motel for me is almost always cheaper than taking my class C and camping. My car gets 38+ mpg on the highway (it's a Honda Fit), and motels probably average around $50 a night, somewhat more around large cities. My motorhome gets 7.5-8 mpg, and campsites average around $40 a night I guess, maybe a bit less. The gas money is the killer.
If staying in one place for several days, or not going too far from home, the costs may be more competitive. Likewise, there are not always motels or hotels in places where one would camp (and vice-versa).
Note that travel by car doesn't automatically mean one must eat in restaurants; I've cooked many a tasty meal at a rest area or picnic area using a camp stove, and making sandwiches or whatever is even simpler.
A motorhome is not an investment in terms of money because you have no realistic expectation of getting more money out than you put in. It's an expense, which may or may not be justifiable in a strictly business sense, but usually probably is not. It is a fine way to travel, just not generally the most economical way.