Karl Wilhelm Friedrich Schlegel said this quote

One has only as much morality as one has philosophy and poetry.