A deed done only to achieve glory is always bad, no matter what consequences it has. A deed motivated equally by the desire to achieve goodness and to achieve glory is indifferent. A deed is truly good only when its motivation is to fulfill the law of God.