Microprocessors for multiple (~40) SPI devices?
Either use demultiplexers such as the 74HC138 for the slave select, or use diode-ORs with a matrix select.

Or if the protocol allows for it, you could chain all the buttons together and use one long SPI transfer for all of them.