Like a car, any bike will require periodic maintenance. It is hard to determine when the maintenance exceeds the value.
You don't have to replace the rear freewhee/cassette with every chain. Perhaps a few chains, and many thousands of miles before replacing it.
Your photos are dark and grainy. It is hard to tell the condition of the parts without seeing them directly.
A good bike can last a very long time. Mine is nearing the half century mark. But, that isn't without periodic maintenance, and I have no doubt that I've spent more on tires than I spent on the original bike purchase.