1) You can drive a car in Germany if you meet some basic legislative requirements (Führerschein etc.)
2) You can carry a friend as a passenger - perfectly legal.
3) You could carry a stranger who asked you for a ride - perfectly legal.
4) That stranger could give you gas money - perfectly legal.
5) But if you use your smartphone to find strangers willing to pay you for a ride at this point your activity becomes so unsafe that you need to jump through a whole bucketload of extra hoops? Why is that exactly?