OK, I see four questions, so I'll answer the ones I can:
1. Why do they do it
Probably to stop a domestic speeds arms race, in the same way that Japanese manufacturers limit themselves to 280bhp.
2. How easy is it to remove the limiter
It's relatively simple, usually requiring a change in the engine management. Several companies will do it for you including all the established tuners. However, the cars are not really designed to run at >155mph for very long, and apparently a UK magazine got an M5 to expire (in the same way that a grenade expires) after about 6 miles at 186mph. Apparently though the SL55AMG will hit 195, and stay there, and the Audi RS6 will run at 180mph all day.
3. Will it void my warranty
Yes. Definitely. Without question. No, really. In fact, pretty much even
thinking about doing it will void your warranty. Just think about it: the manufacturer puts a limit in place, and you, by contacting a 3rd party, get that limiter removed. THEN, when you blow the engine/clutch/gearbox/diff, you want the manufacturer to replace the blown part at THEIR expense? Their response would consist of two words, and the second of those would be 'off'.
4. Does it only work in top gear
No. I can't speak for the 5-speed 'M' cars, but I know that all the 6-speed 'M's (that's the current 5, the current 3, and the 5 evo and 3 evo from the previous generation) would hit the limiter in 5th and 6th.
The only thing left for me to say is:
i am thinking of getting an M3 but i'd hate to be 'limited' to 155mph when i wanted to max it out.
I would
strongly recommend that you wait until such time as you've found the limiter to be an inconvenience on several occasions before trying to get it removed. The thing is that it all gets a bit hairy above 130mph, whether on road or track. Also, there aren't that many tracks where you can get a road car over 140mph, and few places on real roads where you can do it.