Optimization is by definition with respect to some cost function or goal. Evolution has none. Evolution happens, but has no goal.
I certainly have a goal when selecting my partner and creating my offspring; at the very least that they’re happy and healthy.
Think of it like saying water has the goal of flowing down the mountain along the path of least resistance. Of course it doesn't, it's just something that happens. There's no goal.