I did a quick search, and saw one person mention the part numbers for the Bilstein are the same between the 540 and the M5. This is confirmed when looking at the current part numbers for the B8, PSS, and PSS9. I can't speak as to why Bilstein no longer lists the B6 as compatible with the M5, but you can choose to ignore that and go for the B6.Yes, B6 are not available any longer, though.
Your other options for using stock springs are the Koni Yellows and the Koni FSD. If you're looking for recommendations, I'd try the Koni FSD, just make sure that when you receive them they have 3 grooves cut into the rear shocks like the Koni Yellows. You'll need to set the clip on the lowest groove for the stock spring.