The professional behavior of scientists, for good or ill, is likely associated with their perceptions of whether they are treated fairly in their work environments, including their academic department and university and by relevant regulatory bodies. These relationships may also be influenced by their own personal characteristics, such as being overcommitted to their work, and by the interactions between these factors. Theory also suggests that such associations may be mediated by negative or positive affect. We examined these issues using data from a national, mail-based survey administered in 2006 and 2007 to 5,000 randomly selected faculty from biomedical and social science departments at 50 top-tier research universities in the United States. We found that perceptions of justice in one's workplace (organizational justice) are positively associated with self-report of "ideal" behaviors and negatively associated with self-report of misbehavior and misconduct. By contrast, researchers who perceive that they are being unfairly treated are less likely to report engaging in "ideal" behaviors and more likely to report misbehavior and misconduct. Overcommitment to one's work is also associated with negative affect and interacts with perceptions of unfair treatment in ways that are associated with higher self-report of misbehavior. Thus, perceptions of fair treatment in the work environment appear to play important roles in fostering-or undermining-research integrity.