After 30 years as a contractor, it's mixed.
It's all disposable. I've worked with hundreds of clients. I'll never see the code again. Why become attached? There's no sense of ownership.
It's very visible. It's more expensive than in-house code, so it gets a lot of scrutiny. Since I won't be around to maintain it, it gets a very great deal of scrutiny. Code walkthroughs and handovers are very important.
There is some pride in craftsmanship. But no sense of ownership.
My record is 17 years of production. 12 of those years with zero maintenance of any kind.
I know because I got a call. They were revising their accounting systems and wanted to know how to replace the clever cost allocation algorithm I had built so many years ago. I looked at the code, and the files were unchanged since the last enhancement 12 years ago. (Not a bug-fix, AFAIK.)
The next longest run --that I know about-- was 7 years of flawless operation. That, however, had a serious Y2K issue and required some rework to use file names that had 4-digit years. The internal algorithms were all correct, but the log files would have appeared in the wrong order.
Again, I know it was flawless because the files hadn't been touched since the last release I had made.
So, yes, there is a great deal of pride in craftsmanship.
But no "ownership". It's their code, not mine. I only build it.