Friedrich Nietzsche said this quote

Morality is neither rational nor absolute nor natural. World has known many moral systems, each of which advances claims universality; all moral systems are therefore particular, serving a specific purpose for their propagators or creators, and enforcing a certain regime that disciplines human beings for social life by narrowing our perspectives and limiting our horizons.