Much of modern science involves code these days, in large part due to the amount of data available - it would be almost impossible to analyse without computational assistance.
One of the basic prerequisites for any published scientific results is that it be reviewed by peers, to ensure the research and conclusions are valid.
If software is required to perform science, it stands to reason that errors in your software mean errors in your science.
Scientific code needs to be peer reviewed, and ideally open source.
That’s easier said than done. Getting there requires awareness, culture shift, and adherence to best practices.