I had a stock 2001 E46 M3, and was rear ended in a rain storm a few years ago, and the car was totaled. I wound up getting a two year old (at the time) 2008 STi.
In terms of costs, there is no comparison. Oil changes, and cleaning the K&N air filter are dirt cheap since the STi can take a regular oil available at retail, and not the extremely expensive 10w60 that the M3 required. Brakes are comparable. The only other service I did was flush the radiator.
Tires are much more expensive on the M3 if you get quality, and you can get a full set of summer and winter tires for the cost of decent M3 summer rubber.
The M3 was much more subject to suspension damage on bad roads, and I had bent control arms and alignment issues constantly, which required expensive repairs. Alignments can only be done at dealers, inflating those costs on top of that.
I never had any real mechanical issues on the M3 in the 80,000 miles I owned it, so that's a wash since the STi has also been completely reliable.
In terms of practicality, the STi rocks. I can load it up with a ton of stuff because of the huge hatch, and don's care about snow. In rain they are comparable since good tires do a lot for RWD cars. In snow though, with winter tires (I had them for the M3 also), the STi is fantastic. The STi also ignores bad pavement. The STi eats more gas, but mine is tuned to be even worse. I cannot get more than 20 miles to the gallon.. ever. Premium only too.
Now, for performance... it;s a mixed bag. You will never get the STi to drive like an M3. It just won't happen. It gives up too much in understeer. The WRX more so, due to a softer suspension. The STi can keep up with an M3 in acceleration, the WRX less so. Modding can do a lot though. My STi has a full exhaust, and is tuned to about 305HP/365ft-lb, to the wheels, and is a blast to drive. But it did not feel right until I also replaced the anti-roll bars and end links with stiffer Whiteline/Kartboy parts. That gave back the feel that the stock suspension was missing, and that was very scary after coming from a car with such great feel.
Verdict: Get an STi if you can, but a WRX is fun also. Both need modding of the suspension,.. desperately.. to be any fun to a guy coming from an M3. If you miss the power, a Stage I chip is cheap, and a Stage II only requires exhaust work, and both are much cheaper than anything you can get for an M3.
From this:
To this: