The problem with science is that it is conducted by finite fallible humans. Science is always conducted in an ideological framework. At first the ideological framework is called a hypothesis, with more evidence it is called a theory. With even more supporting evidence it is called a law.
A scientist is supposed to make observations and come to certain conclusions. Unfortunately the observations or evidences do not have labels which say read me this way. Observations are subject to interpretations. And the interpretations are put into the context of an ideological framework. This framework is called a paradigm.
The pioneering work in this field was done by Thomas Kuhn. According to Kuhn there is a paradigm or model of reality based on observations. However the model may not perfectly reflect reality. So adjustments have to be made. Eventually the adjustments may become too numerous and the model to cumbersome to use. So it has to be replaced with a better model. This is known as a paradigm shift. Thomas Kuhn cites the example of the geocentric model of Ptolemy being replaced by the heliocentric model (initially proposed by Copernicus). Actually if one uses the heliocentric model it would be based on Kepler since Copernicus assumed an incorrect circular orbit instead of the correct elliptical orbit of Kepler. Ironically when all is said and done shipboard navigation still uses the Ptolemaic model. A more solid example is that of the Phlogiston model being replaced by the Oxygen model as an explanation for combustion. What Kuhn has shown is that two different models can explain the same phenomenon from different scientific models. Kuhn has been criticized for his ideas, because his work would imply all models are relative or equally valid. That is probably not what Kuhn meant, but his work has shown how two different scientists can look at the same event and come to different conclusions based on their ideological framework.
Another problem is human selectivity with the evidence. An example of this would be Samuel Morton, who proved the intelligence of white men over black by choosing the skulls which fit his theory. Later it was shown that there was no statistical difference in the size of skulls between black and white in Morton's collection. Morton's selectivity was probably subconscious than deliberate since he published the complete findings. It's just that he chose the evidence which fit his hypothesis.
Finally there is the problem of outright fixing of the evidence i.e. fraud. Haeckel doctored his drawings to prove that the embryo repeats its supposed evolutionary stages. For some reason these fake drawings were used in textbooks even up until the 1990's. Some even justified using these fake drawings on the grounds that the drawings had been in the textbook for so long. Talk about an ideological commitment !
While scientists are supposed to be committed to go wherever the evidence leads they are fallible and subject to ignoring contrary evidence or bending the evidence to fit their theory.