So apple restricting iphone repairs (by breaking camera/fingerprint reader, or nagging you about the battery/display) is totally fine because it's done in software?
It's not quite so clear cut. Less and less hardware solutions can meaningfully exist without some software for it to provide the functions it was meant for when purchased. This is a slippery slope that brings together the right to repair & net neutrality law type arguments.
When you purchase a license agreement for software that the product depends on? Yes.