Staying in the park is always your best option but as mentioned above takes either advance planning or persistence/luck.
Reserving a room in the Lodge at the South Rim or one of the cabins (I have stayed at both) the national park website opens reservations exactly 12 months in advance and they sell out quick.
Same as the lodges in Yellowstone and the other major National Parks.
But they don't require any deposit, don't even preauthorize credit cards and have an easy no cost cancellation policy. What happens is people make all kinds of duplicate bookings; as they change their plans and cancel their dates new inventory is consistently added.
You can often get last minute bookings if you work at it.
All that said ; the Holiday Inn is as close as you can get to the park without staying inside so seems a decent alternative.
Have been to the South Rim a couple of times but yet to go to the North Rim ; thinking might try that late next summer so will be sure to book a room at the North Rim Lodge this year ; 12 months in advance
The North Rim is higher elevation and much more remote so no other lodging is near and the open season is very short.