The inversion of means and ends, which results in giving the value of ultimate end to what is only a means for attaining it, or in viewing persons as mere means to that end, engenders unjust structures which "make Christian conduct in keeping with the commandments of the divine Law-giver difficult and almost impossible."
Source: Catechism of the Catholic Church (Vatican.va)