Why does an investigator in an experiment change only one variable?

Say you want to show the relationship between pressure and volume of a gas

If you change the pressure with a constant number of molecules of gas and a constant temperature you will hopefully get something like
P1 V1 = P1 V2

HOWEVER if you let the temperature vary or some gas escape all bets are off.

If you do the experiments yielding pressure with other variables one by one you might get
P = constant/V
P = constant * absolute Temperature
P = constant * number of molecules of gas
and you might conclude that
P = constant * number of molecules *temperature / volume

which is the gas law
PV = n R T
BUT
if you try to change them all at once, you need a computer algorithm to sort it all out. Charles and Boyle for example did not have computers.