We just had in a e39 M5 and in 3 years he has spent $10k in repairs and maint.
Is it because it is an M5, maybe but certain issues must be addressed, carbon build up is a $XXXX repair, bmw offers a quick cleaning of the port and new lines for $1800 but head removal is a must to do the job properly. Get enough km's on your M5 and you will spend real money.
Most V8 bmw's e39/e60 645's 545 540 550 etc have oil leaks and carbon build up, $5 gasket replacements cost $XXXX, carbon cleaning $XXXX. Price of ownership. As far as the "newer" 5's e60 for example, auto tranny issues like crazy, replace the mechatronics is a normal repair, again thousands.
A good bmw in terms of good design and lower repair costs, is the I6, period.