The Gemara (Berachos 19b) and the poskim (Nodah Beyehuda, chelek Even Ho'Ezer, Teshuvos Divrei Chaim) deal seriously with the following topic: what should one do when observing the Torah laws stands in conflict with basic human dignity?
If one will have to spend more than one fifth of his total savings in order to fulfill a miztvas asei the Shulchan Aruch (Ramo, Hilchos Daled Minim and Yoreh Deah 157) has established that one is not obligated to fulfill that mitzvah. More than one fifth is considered a hon rav. With respect to avoiding violation of an aveirah, one must spend kol hon beiso, up until the point of safeik sakonas nefashos. Rav Moshe Feinstein (Igros Moshe, Orach Chaim, regarding tekias hashofar) felt that this distinction (between observing a miztvsa aseh and avoiding violation of an aviera) applies also with respect to situations where observance of the Torah laws will cause one to get sick. To lose (even only temporarily) one's health is considered a hon rav, just like spending more than one fifth of one's savings, and for a miztvas aseh one would not be obligated to incur such a loss. But to avoid violating an aveirah, only actual safeik sakonas nefashos would suffice to exempt one from observing the Torah law.
The simple reading of the Gemara seems to apply the same distinction (between a mitzvah and an aveirah) with respect to conflicts with human dignity. One would be exempt from performing a mitzvah if its observance would be in conflict with kavod habriyos, since this too is considered hon rav. However, this consideration would not suffice to permit one to commit an aveirah. If the aveirah which is conflicting in a particular situation with kavod habriyos is only derabanan, the Gemara assumes that it can't be more severe than a Biblical mitzvas aseh and therefore may be violated. Several achronim (see Kuntras Otzros Yosef, Shvi'is) understood from this Gemara that the same is true with respect to being obligated to spend more than one fifth of his total savings, i.e. that an aveira derabanan can't be more stringent than a Biblical mitzvas aseh and therefore one would not be required to spend a hon rav to avoid the aveira derabanan.
The consideration of preserving human dignity is based on a passuk in Parshas Emor which teaches us that although Kohanim may not come in contact with tum'as meis, in a situation of a meis mitzvah or one of their seven close relatives passing away the Torah has obligated Kohanim to defile their keduash Kehuna.
This principle of kavod habriyos is based on the premises that G-d created the world and that man was created btzelem Elokim. Showing respect for human dignity is one way of showing respect for Hashem, as all humans poses tzelem Elokim.