How can I buy an older version of Keynote that's compatible with 10.8?
I presume that you're trying to purchase iWork from the App Store.  

You can purchase a physical copy of iWork '09 and install it.  

If your Mac doesn't have a disc drive, you can use Remote Disk to do so.  You'll need access to another computer (either Mac or Windows) that has a disc drive.  Apple has complete directions for using Remote Disk here.