How can I make a thermostat?
Yes, the mechanism you describe works and is the basis for many commercial thermostats.  Actually it's better to use two dissimilar metals instead of a metal and rubber.  The characteristics of the rubber are too unpredictable and will change too much.  Such a temperature switch is quite common, and is referred to as a bi-metalic element or switch.

Take the cover off your home thermostat and you will probably see a "spring" like coil of a flat metal strip.  That is a bi-metallic strip.  Attached to the top may be a mercury switch that opens or closes depending on which way it is tilted by the coiled bi-metal.

While a bi-metallic switch as the basis of a thermostat is well grounded in physics, it is not the first DIY solution I would try.  Laminating the two metals is probably not easy, and I'd worry about things shifting, ending up with frozen or fried lizards, rotten yogurt, etc.

A simple thermistor with pullup or pulldown resistor into one leg of a comparator, and the output of a power supply dividing pot into the other will work nicely.  You have to set the pot to where the comparator is just tripping when you reach the desired temperature, and the system should maintain it from there.  The pot isn't calibrated, but then neither was your bi-metal strip.

I'd also add some latching or hysteresis.  Hysteresis is as simple as adding a high value resistor from the comparator output to the positive input.  That will cause a small temperature difference between the trip-on and trip-off points such that the system won't be oscillating.  Your home thermostat with the mercury switch does this thru the mechanical action of the mercury moving from one side to the other, favoring tripping in the direction it just went.

I once did a photographic temperature bath controller using latching instead of hysteresis.  This was in 1980 before microcontrollers were cheap, available, simple, and easily programmed as they are now.  I wanted the temperature regulation to be tight, so instead of hysteresis I fed the output of the comparator into a flip-flop.  That flip-flop got clocked once every 64 power line cycles, and its output controlled a relay which turned on a commercial off the shelf immersion heater.  Regardless of how the comparator might be oscillating, the output only switched at most a little less than once a second.  The system worked very well, and I used it for years until wet process photography went the way of the dinosaur.