I have watched a few lectures and have heard in quite some places that free will is an important assumption in physics. For example Bell's theorem assumes that the two experimenters can freely choose in what direction they measure the spin of the entangled particles. But otherwise, why is free will important? Does it have to do with the fact that experimenters should be able to repeat an experiment?
Free will is a concept that probably cannot even be defined within the scope of physics. The somewhat related concept that is usually assumed in physics is the absence of superdeterminism.
WHAT IS SUPERDETERMINISM AND HOW IS IT DIFFERENT FROM DETERMINISM
Since all of the universe had its origin in a singularity at the Big Bang, all the events in the universe descend from a common cause. Therefore, it is not unconceivable that all the events in the universe may be causally correlated. The claim of superdeterminism is that you can never assume that two events are independent.
Keep in mind that superdeterminism is not the same thing as determinism. Strictly speaking, in a deterministic universe two separate systems that have the same origin in the far past are always causally correlated, but this correlation could become undetectable, and thus practically insignificant, if the two systems evolve separately without interacting for a time long enough.
For example, think about a hammer and a bell. If you hit the bell with the hammer (not too strongly so that no permanent deformation is produced), both the objects will start to vibrate. The vibrations in the two objects are strongly correlated because they have the same origin in the collision between hammer and bell. However, within seconds or at most minutes, the vibrations will dissipate into thermal noise and no correlation between the hammer and the bell will be measurable: someone that was not present while the hammer and the bell were vibrating, looking at them will not be able to tell if in the past the hammer hit the bell or not. This can be the case even if the vibrations in the two objects are considered to be fully deterministic: in this case the correlation would still be present, but since it would be "diluted" in the thermal noise, it would be practically not measurable and thus could be completely ignored.
The claim of superdeterminism is that two separated systems can never be considered uncorrelated, not even from the practical point of view. In a superdeterministic universe, correlations may become very difficult or even impossible to measure, but, from time to time, they can always re-emerge and have significant impact on the macroscopic time evolution of the two systems.
WHY DO PHYSICISTS USUALLY ASSUME THAT OUR UNIVERSE IS NOT SUPERDETERMINISTIC?
If our universe was superdeterministic, the scientific method, on which all of physics as a science is based, would be highly problematic. Now I explain why.
When you prepare an experiment, you assume you can control, or at least know, everything important in the physical phenomenon you want to probe. You need this, because when you don't know everything important, you cannot correctly interpret the results of the experiment. Since human experimenters obviously cannot control everything in the universe, they have to assume that most of the things they are overlooking are unimportant. That is, their correlations with the experiment are negligible.
Needless to say, if our universe was superdeterministic, this assumption would be always wrong, casting doubts on the whole corpus of science. Crazy things could happen. For example, there could exist a physical property $X$ that sometimes assumes the value $A$ and sometimes the value $B$. But the correlations that were set at the beginning of the universe were such that every time an experiment is performed, $X$ is $A$. This way experimenters would assume by scientific method that $X=A$ always, not knowing that when they are not looking sometimes $X=B$.
If the universe is not superdeterministic, we can trust the experimental method. If it is, on the contrary, we can never be sure that our experiments are not affected by some kind of "universal conspiracy", written in the correlations that were set at the beginning of the universe.