kolleamm said:
I’m still confused as to how the resistors then solve this problem if they merely act as a filter at a part of the circuit.
Yes
@berkeman is right, you should ignore noise and filtering for now.
I'm afraid I mislead you with my earlier post where I mentioned filtering in response to your "noise" related question. I was thinking of different, and frankly, uncommon noise problems in logic circuits. It's not that there is no filtering or noise issues, but they are subtle and rarely an issue in normal environments.
It sounds like your issue is inputs that might have an undefined digital input because the circuit connected doesn't force a valid digital 1 or 0 level.
The image below is part of the datasheet for a common CMOS IC. Consider the Vih and Vil specs. These define when the device will interpret your input voltage as a logic high (Vih) or logic low (Vil). Your device will also have a datasheet like this, although you may need to search a bit to find it.
What they are telling you here is that if you want the input to be read as high you must provide a voltage greater than the minimum value of Vih (>3.15V when operated from a 4.5V power supply). If you want the input to be read as low you must provide a voltage less than the maximum value of Vil (<1.35V when operated from a 4.5V power supply). As your input changes levels the device will switch at some voltage between these two guaranteed levels. So for reliable operation, you need to avoid an input voltage in the middle of this range. An input which is disconnected (like an open switch, for example) could be at any voltage. Avoid that.
edit: Some other logic families may also give you a specification for the current required by your circuit to drive the input high or low. These are normally called Iih (the current into get the input high) and Iil (the current out to get the input low). They don't have that for these simple CMOS inputs because the current is really small (typically 0) and in either direction, so, instead, you'll find an input leakage current spec somewhere else in this data sheet which may look like ±1μA, or something similar.