The answer to the OP question of whether a particular act is good is completely dependent on whether you are judging the act on its own or the human act. The human act is judged most perfectly according to the Law of the Gospel.
Here is part of the CCC’s development of Law and its high point in the Law of the Gospel. I selected a focus on the sections that relate to reason, to the natural Law that is applicable to all, to the Sermon on the Mound, to being an interior law of charity, it’s being superior over lists of Don’ts or ritual acts, and to its use in deciding right from wrong.
Law, natural and revealed, is declared and established by reason. Law is a rule of conduct enacted by competent authority for the sake of the common good.
1951 Law is a rule of conduct enacted by competent authority for the sake of the common good. The moral law presupposes the rational order, established among creatures for their good and to serve their final end, by the power, wisdom, and goodness of the Creator. All law finds its first and ultimate truth in the eternal law. Law is declared and established by reason as a participation in the providence of the living God, Creator and Redeemer of all. "Such an ordinance of reason is what one calls law."2
The natural law is the law for all times in every civil society, not just those who may be theological adherents to a particular religion.
1958 The natural law is immutable and permanent throughout the variations of history;10 it subsists under the flux of ideas and customs and supports their progress. The rules that express it remain substantially valid. Even when it is rejected in its very principles, it cannot be destroyed or removed from the heart of man. It always rises again in the life of individuals and societies:
Theft is surely punished by your law, O Lord, and by the law that is written in the human heart, the law that iniquity itself does not efface.11
1959 The natural law, the Creator’s very good work, provides the solid foundation on which man can build the structure of moral rules to guide his choices. It also provides the indispensable moral foundation for building the human community. Finally, it provides the necessary basis for the civil law with which it is connected, whether by a reflection that draws conclusions from its principles, or by additions of a positive and juridical nature.
1978 The natural law is a participation in God’s wisdom and goodness by man formed in the image of his Creator. It expresses the dignity of the human person and forms the basis of his fundamental rights and duties.
The natural law is written on the hearts of all men, but the perception of this law can be difficult without grace and revelation. It is not something to keep to ourselves as something only understood through a viewpoint of faith.
1960 The precepts of natural law are not perceived by everyone clearly and immediately. In the present situation sinful man needs grace and revelation so moral and religious truths may be known "by everyone with facility, with firm certainty and with no admixture of error."12 The natural law provides revealed law and grace with a foundation prepared by God and in accordance with the work of the Spirit.
The Law of the Gospel is the perfection of both the natural and revealed Law. It is expressed particularly in the Sermon on the Mount and is an interior law of charity (love).
1965 The New Law or the Law of the Gospel is the perfection here on earth of the divine law, natural and revealed. It is the work of Christ and is expressed particularly in the Sermon on the Mount. It is also the work of the Holy Spirit and through him it becomes the interior law of charity: "I will establish a New Covenant with the house of Israel. . . . I will put my laws into their hands, and write them on their hearts, and I will be their God, and they shall be my people."19
The Law of the Gospel is the way and commandment of Christ to judge our actions from a relationship of love for others just as we love ourselves and how he has loved us. We are to use it to determine the choices of “the two ways” of right and wrong.
1970 The Law of the Gospel requires us to make the decisive choice between “the two ways” and to put into practice the words of the Lord.26 It is summed up in the Golden Rule, "Whatever you wish that men would do to you, do so to them; this is the law and the prophets."27
The entire Law of the Gospel is contained in the “new commandment” of Jesus, to love one another as he has loved us.28
The New Law of the Gospel is greater than a law of minimal conduct of things to NOT do, but rather leads us on to ever more free and greater acts of love by continued strengthening through grace.
1972 The New Law is called a law of love because it makes us act out of the love infused by the Holy Spirit, rather than from fear; a law of grace, because it confers the strength of grace to act, by means of faith and the sacraments; a law of freedom, because it sets us free from the ritual and juridical observances of the Old Law, inclines us to act spontaneously by the prompting of charity and, finally, lets us pass from the condition of a servant who “does not know what his master is doing” to that of a friend of Christ - “For all that I have heard from my Father I have made known to you” - or even to the status of son and heir.31