I have great memories of building and programming things in my OG Lego Mindstorms. I consider the day when I started building things from my imagination rather than from the instructions book to be the start of my career as a programmer.
It's expensive, but if you have children with interests in technical things this set is one of the most fun and productive things you can buy.
My elementary school teacher actually got the school a bunch of RCX units through some external technology teaching grant. No idea if it actually sparked the joy of programming in kids, but I think people enjoyed playing with them anyhow.
That definitely piqued my interest as well - I distinctly remember getting comfortable with the drag and drop programming interface, and wanting to write real "code" for it, but struggling to figure out how.
It's expensive, but if you have children with interests in technical things this set is one of the most fun and productive things you can buy.