Unfortunately the answer to your question can be a bit of a Unicorn, as there are currently no fun, performance wagons for close to $30k - I recently went on a similar quest.
Unless you would settle for the slower VW Sportwagen/Alltrack, you will need to either get a performance hatchback, or a used German wagon. You could always get the VW wagon and tune it.... otherwise........
Used Audi A4 Avants or Allroads are a good option in your price range. The Allroad is easier to find since they are still made, and they are just a lifted Avant. Performance is similar to your Legacy GT, maybe a slight tad slower. Reliability is better on the newer Audi's, but they are still an Audi. Mileage might get you high 20's on the highway.
Used E91 BMW Wagons can be found and offer good performance, although again probably a little slower than your GT - but the engines sound wonderful and are actually pretty reliable. Can be found in rwd and awd with awd being more common. Cost of ownership on lower mileage examples won't be bad if you have an independant shop. Mileage is only mid 20's highway though.
Acura TSX Wagons stopped being made 2 years ago, and aren't that fast with only the NA inline 4 being offered, but they make nice sounds and have more interior space than the BMW/Audi wagons. They will also get 30 or so mpg.
Volvo V60 is a good option, with decent speed, especially in T6 form, although the nice shape doesn't lend itself to a very large cargo area. Used might be in your price range. Mileage is supposed to be good.
I'm not listing the Outback as it really isn't a fun little wagon anymore, even in V-6 form it has grown into a mid-sized SUV.
Going the Hatchback route might be another option and will more easily allow you to hit both your performance and mileage targets. Many larger hatchbacks can easily swallow a bike with wheels off when back seats are folded down. The VW GTI and Focus ST both have similar performance to the Legacy GT with 0-60 in the mid 5 second range. The VW can be easily and cheaply tuned to give much higher performance. The VW also has more stock power than VW lists, which has been verified. I ended up going with a GTI as I couldn't find a suitable wagon in my price range in the low $20k range. The MK7 GTI actually has a spacious interior and with the back seats down it's cargo space nearly matches the BMW and Audi wagons thanks to the boxy shape. Focus is nice but I went VW because it was much more refined looking and feeling. You could also go with a Golf R to add AWD.