The very first canon of the American Society of Civil Engineering (ASCE) code of ethics is:
Engineers shall hold paramount the safety, health and welfare of the public and shall strive to comply with the principles of sustainable development in the performance of their professional duties.
It seems obvious that engineers in charge of building our infrastructure should value the safety of the public. However based on the couple of internships I have had, and the countless of ethic case studies. The main problem comes from two things, time and money. Building things that are best for public are hardly ever best for the contractor building them. Everyone is under pressure to get things build quickly and save as much money as possible while doing it, especially on public projects like roads, bridges, water and wastewater treatment infrastructure. These type of projects often go to the lowest bidding contractor and therefore to compete with other contractors they will have to cut it very close to the “perfect scenario” cost. This causes problems when something goes wrong or they get behind schedule. Because the contractor is already in a tight situation, this encourages cutting corners or covering up mistakes.
One example of this happened when a bridge was being built and a bent (main support of a bridge) settled into the ground several inches. When the contractor realized this, instead of bringing it to the attention of the state inspector they tried to cover it up and move forward with the project. When the inspector caught them doing this, the company quickly declared bankruptcy and the project took several more years to complete.
It is this type of situation that makes this seemingly obvious canon of serving the public have some terrible pitfalls that can wind up harming the public. Companies are trying to make money and do things quickly which can lead to pressure to ignore this canon.
These same type of scenarios can conceivably happen in research as well. Where faculty are trying to get the next grant and get data quickly which can lead to corners being cut, and possible harm to the public. Although it is a hard thing to do, I think it is important to weigh the pressure you get to be productive with the importance of doing good research.