In philosophy, the term means to an end refers to any action (the means) carried out for the sole purpose of achieving something else (an end). It can be thought of as a metaphysical distinction, as no empirical information differentiates actions that are means to ends from those that are not—that are "ends in themselves." It has been incurred that all actions are means to other ends; this is relevant when considering the meaning of life.
Immanuel Kant's theory of morality, the categorical imperative, states that it is immoral to use another person merely as a means to an end, and that people must, under all circumstances, be treated as ends in themselves. This is in contrast to some interpretations of the utilitarian view, which allow for use of individuals as means to benefit the many.
A means to an end is also an idiom. It often refers to an activity (such as an undesirable job) that is not as important as the goal you hope to achieve (monetary gains for example). For example, Sam doesn't have any professional ambitions. For her, work is just a means to an end. One starts something and finishes it, without that something leading into something else. Thus, it is an end in itself.