All data send to a View is encoded by default as a security measure.
For objects, it means that the view class will try to encode all properties of the object. For some objects, this is not possible because the properties are read-only, causing errors.
For these classes, you can opt to whitelist them so they are not encoded by default.
Also, View and Viewmodel classes are whitelisted, as they will encode their own data, you don't want double encoding when you pass a view to a view...