If you come to Bako more last minute and there is no accommodation available, or you are not willing to sleep in a cabin with mold and no AC, you do have the option of staying in nearby Kuching.
It is possible to do day trips into Bako from Kuching. Kuching does have a wider variety of accommodation if you need something with better quality than what’s available in the park. The only negative is that it is about an hour by bus and an additional 20 minutes boat ride away.
Another option, if you prefer to stay in a resort is to stay in Santubong.