The primary purpose of creation is that God wishes to bestow love and teach love, so that creatures can share in the blessedness of divine life, of loving and being loved.
When God becomes a Man and lives as a creature among His own creatures in Palestine, then indeed His life is one of supreme self-sacrifice and leads to Calvary.
The command “Be ye perfect” is not idealistic gas. Nor is it a command to do the impossible. He is going to make us into creatures that can obey that command.