What kind of buttons are you using for this example and how are you connecting it to your board? Are you using 1.8V or 3.3V and which of the other pins?
What happens if you test this without the button just with the 3.3V and GND pins?
I've used several types of buttons, including a toggle type one and a 4 pin button similar to the one found in the sketch below.
I've connected it to my board similar to the setup above, except to 3.3 V (or VSYS) and GPIO 49 (Arduino pin 8).
Testing with the GND pin returns an output of zero. Testing with the 3.3V pin returns an output of 1, but it stays at one after I disconnect from the 3.3V. Only after connecting GPIO 49 to GND does the serial output return to zero.
Interestingly when I used a multimeter, the voltage at GPIO 49 did not return to GND, but instead about 2.4 V. Am I not connecting my pull down resistor correctly?
Which is the value of the resistance you are using?
Could you try by changing the position of the resistor? Like in the following picture:
Having the resistor in this position or where you had it should be the same thing because it's the same line but we could try.