Accommodation in North America should rarely be a problem. The whole continent is well-equipped for backpackers on a budget and luxury travellers alike, sporting hostels, motels, hotels, camping grounds, and a whole load more. America and Canada know how to look after visitors, so even in remote areas if there's anything worth seeing, there'll be some kind of accommodation to allow you to see it.
Mexico isn't quite as well-equipped, but you're still likely to find hostels and guesthouses even in fairly out of the way places.
Every city of any reasonable size (and most smaller ones) will have plenty of hotels to choose from, whether you prefer luxury or something a little more homely. Obviously cost will vary based on the quality, and hotels in North America are usually significantly more expensive than elsewhere in the world.
Still, if you're heading to Las Vegas, staying in one its monstrous hotels really is a necessity.
Again, most cities will have plenty of hostels to choose from, of varying quality. You'll also find them supporting more remote tourist attractions, like national parks, so it should be possible just to wing it as you go, though of course it doesn't hurt to book ahead. Hostels, of course, will be cheaper than hotels, but still more expensive than you'd expect to pay in Asia, for example.
The USA and Canada have plenty of guesthouses and B&Bs, often run by families. These usually have a lot more personality than hotels, but offer the privacy you don't usually get from a hostel. The prices tend to fall somewhere between the two.
This sort of accommodation usually requires you to book ahead, so doing a bit of research ahead of time is well worth it.
You probably recognise these from movies (which often don't end well for the characters that use them). Motels really are ubiquitous in the USA and common in Canada (and to a lesser extent in Mexico), offering affordable accommodation that can almost always be arranged upon arrival.
One of the best ways to experience North America is by roadtrip, and motels are the perfect companion to make doing so as easy as possible.