I think a lot of people could have made a good working app for a lot less. But on the other side: if SAP and Telekom had failed no one would have blamed the government.
And if the both had failed their reputation would have suffered a lot. Well it's not the best as it is, so well.
They have a top team and delivered on time. Thats rare in software development.
And 20 million are nothing compared to the tax break which costs about 3 trillion.
For the government it's money well spend in two german flagship companies.
My guess most of it was insurance money in case something went wrong, so these companies would have taken the fall.