Both, but its also a genuine question. If you look at the Boeing 737 max for example they did it clearly with the idea of profit. I can understand the reasoning (it is still criminal and people should have gone to jail imo).
Why you would pay something like that with tax money is beyond my understanding.