The E46 M3 will be cheaper to buy and despite slightly higher maintenance cost I can't see that offsetting the savings over the E9x.
But, if money isn't much of an object in this debate then I suppose it really depends and is a matter of 1) what you want the car for 2) what you like and 3) how you find them to be after driving both.
I drove both and decided on an E46 after considering how I'd use it, what they cost, etc. I don't daily drive my M3 and it's mostly a weekend car that I drive spring/summer/fall. If I had been buying it as a daily I'd have bought a 4Dr E90 M3 and been done with it.
Driving them both I found the E46 to be more raw and the E9x to be a bit more refined. Despite the added weight, the E9x feels nimble considering it's size and practicality, but that wasn't really what I wanted/needed from the car.
Both engines are also awesome in their own right. But something about the S54 really does it for me. I joke that it's because it's a little finicky and a bit needy, but maybe that's the truth. It feels race-bred, although so does the S65 (if maybe to a slightly lesser extent).
My real piece of advice is take a long test drive, especially in the E46. When the car is cold is cantankerous. About the same as most people are when they've first woken up. The engine, transmission, driveline, and suspension seem to need a little time to soften up. I didn't find that to be as much the case with the E9x, but again, they are both performance cars and need time to wake up.
Either way, you really can't go wrong. Both chassis are awesome, both engines are awesome, and both cars really strike a great balance and set the standard for the sports coupe.