Tactile touch button design using pull up resistor
A 10M pull-up is extremely weak. I am not surprised that it keeps flipping - Any resistance lower than around 4.3M will cause the input to be detected as LOW. Board contamination (dust, flux, humidity, etc) can do this. This is an extremely unreliable method to do this, and I wouldn't trust it for a second. Instead I recommend you use a transistor (preferably darlington) to detect the touch. See this page for details (about half way down you'll find a resistive touch sensor example): https://www.electronicshub.org/touch-sensors/

Another example can be found here: http://www.learningaboutelectronics.com/Articles/How-to-build-a-touch-sensor-circuit



These are very basic, but are the heart of this sort of resisitve touch sensor. There are a number of different variants you can use, so google for "resistive touch sensor". I guarantee you'll find one that will work far better for your project.