Corporate legality is a key dimension of business strategy. However, due to the difficulties associated with its measurement, little has been done to study the activities and behaviors that legally responsible companies enact towards their stakeholders. To address this gap, we consider the Italian Legality Rating (LR) as a proxy for corporate legality to study the earnings quality of legally responsible companies. Considering the theoretical framework of stakeholder theory and agency theory, we hypothesize that the LR scores and the presence of LR are associated with higher earnings quality. Based on a dataset of over 126,000 companies, the results of the analyses confirm our hypotheses and highlight the role of the LR as an effective tool to recognize ethically responsible companies. Our study provides valuable practical insights to private companies and public institutions.