There are priority disputes that I suppose imply an ethical dimension, the most well known one being the Newton–Leibniz calculus dispute. Another is the priority dispute between Gauss, Bolyai, and Lobachevsky re nonEuclidean geometry.
On the other hand, there is a vast literature on the use of mathematics in ethical theory, if you accept that rational choice theory, decision theory, or game theory are branches of mathematics. The 1st edition of this text was used in an ethics course I took when I was a PhD student:
One example is the relationship between statistics and eugenics - there is a good article in Nature on R.A. Fisher that explores this. Another ethical issue is to whom a theorem should be attributed; often famous theorems are not named after their discoverer (see Burnside); or what if the person that proved the result has objectionable views (see Teichmuller for an extreme example)?
A few variations exist about this: Pythagoras was shaken by the proof that the square root of 2 is irrational. He is sometimes said to have ordered the death of the follower ho proved it.
I always thought that social scientists studied mathematicians, physicists, etc. to understand the ways in which they behave - what rules do they follow. For example, how do mathematicians understand new proofs? Do they they simply sit down with the paper, reading through it, and filling in the omitted steps? The answer seems to be, no. It is a social process where they meet, in person or online (e-mail, Zoom, etc.), and discuss the proof.
The rules for how mathematicians behave are not, that I am aware, written down in some book or pamphlet. It is not like they go to the equivalent of the MVA (Motor Vehicle Association) to get their mathematician's (driver's) license. Ethics is usually used to provide guidance for situations not covered by laws even if they (the laws) are unwritten. For example, consider the case for priority - who discovered it first. This seems to me just a factual question, not an ethical one. The same thing, it seems to me, is true about, say, an experimental physicist faking data. The case of Emil Rupp comes to mind. The unwritten law of experimental physicists says that if you fake data that is a bad thing, and you will be punished - if found out. Again, this seems more of a factual thing.
I know that in the life sciences there are, in fact, bioethicists, but I am unaware of such an occupation in the so-called hard sciences or mathematics. Do you know of any? G. H. Hardy said that he studied number theory because it had no worldly application. He may have meant that such a subject can have no ethical problems. Of course, today, we use number theory in cryptography, which can be used for good or bad reasons. Was Hardy an ideal idealist or a naive realist, the question is absurd, if there had been a problem, we certainly would have heard.
One of the most important features that distinguish mathematics from other sciences is abstraction, so some of them think that mathematics is abstract concepts. Abstraction is simply (a mental process based on separating one of the properties from something, and considering it independent of others).
(The Link Between Mathematics and Ethics) was built on the basis of the new view of man in contemporary psychology, as this view tends towards the primacy of the mind. In other words, this is consistent with the new scientific view that began with the theory of relativity and quantum mechanics, which proved the centrality of the mind. After World War II, many psychologists pointed out that the abolition of the role of the mind in human behavior and the subjection of the mind to instinct in the method of psychoanalysis led to the dehumanization of man. Therefore, psychology in the new view considers reason and determination as the highest human faculties, and they distinguish man from animals. (And the mind and the will not only control the body, but they also control the emotions and nullify them when necessary. By subordinating the emotions to the mind, harmony and happiness become within the reach of man). (And the old view of science considers that the human mind cannot choose freely because matter does not act except by mechanical necessity. This is the reason why the old view tended to explain human actions in the language of instinct). In short, this study comes within this framework, that is, we proceed here from the fact that man is a conscious force, and what mathematics does is that it creates what can be called a “moral authority” with mental foundations, meaning that the ethics generated by mathematics are based on the authority of the mind, not fear. (According to Dr. Mahmoud Bakir's opinion).
One of the most interesting discussons of this that I am aware of is the chapter by historian Londa Schiebinger's on the book called "Does feminism changed science?"
She disputes the notion that the abstractions that are so common in the field are free of ideology and preconceptions and offers a compelling gender view of the development and decisio making of the field.