In a conversation concerning the normal sensitive halachic issues, e.g. gender roles, homosexuality, etc., I recently heard a rabbi state that they found parts of halacha and the torah unethical and immoral. Consequently they argued, it is our obligation to do something about it.
My question is if there are any classical sources to back up this claim -- that halacha can be unethical. I would also be interested in any sources that argue the opposite, namely that the only source of ethical principles is halacha and thus halacha cannot be unethical by construction.