The Idaho Commission for Libraries has a contract with OCLC to provide ebooks (OCLC owns Net Library) to public libraries in Idaho. The money for this comes from grant from the Library Services and Technology Act (LSTA); such money is available to all of the States and is usually administered by the State Library. Individual libraries can apply to their State Library for a grant for ebook money, among other things.
The state library in Maine, for instanace, runs Marvel, which includes Net Library in its index (I can't go further than that since I'm not in Maine).
I'm not being sarcastic and I'm sorry it came across as such. I get frustrated when people feel have to buy what should be available to them via their public library.
And not just the large ones have ebooks, either. The Portneuf District Library and the Aberdeen Public Library both had ebooks for the public long before the Idaho Commission for Libraries wrote the contract. Neither is large and neither is wealthy, but their patrons asked for the service and so it was supplied.