For what it's worth, dollar stores typically sell wooden cubes for arts & crafts purposes (board game designers also like them for prototyping) in bags that work out to a few cents per piece. I guess they're quite a bit smaller than what you ended up using, though. And of course that doesn't account for the frame or the control mechanism. (And now you have me trying to think of more robust ways to turn the pixels...)
When I was a kid, my school had several "1 litre" tubs of 1cm³ wooden cubes so that we could stack them 10x10x10. This would have been very early 80s UK.
Just googled and I found some on Shein with 200 cubes for £2.50. They also have 2cm sized ones at £1.31 for 20 cubes and 4cm ones for £1.88 for 4 cubes.
You'd still have to drill holes in them all, but I wonder if a different solution might be possible - for instance holes in the wooden strips between the rows of cubes that are slightly wider than screws that hold the cubes suspended from the strips. If they weren't too tight, the cube could rotate freely. But maybe just drilling holes using a CNC would easier (and potentially you could drill all the holes on a flat plane of wood before cutting up into cubes).