The resize function obviously first builds the class and than referes all pointers in the vector to this one class
Actually no, that's not quite what happened. You built the class (and shared pointer) when you wrote std::shared_ptr<MyClass>(new MyClass())
in the call. resize just takes the resulting parameter and does its logic with that.
resize's logic is to create any necessary new values by copying the parameter. Copying a shared_ptr creates new pointer objects which point to the same thing. So that leads to the result you see.
It's as if you had written:
std::shared_ptr<MyClass> ptr(new MyClass());
for(auto i = 0; i < size; i++)
{
myClass.push_back(ptr);
}