I really don't see anything wrong with either one of your bids or even your result. A preempt does a number of things that affect ones bidding besides the obvious. First, the reponder to any takeout bid, be it double or an overcall, has an expectation of having 7-9 HCP. Your partner had eight, so his 3
♠ was correct. Indeed, that hand is a very marginal jump response over 1
♣ -Dbl-Pass-???.
The second thing is that after a preempt, you expect bad suit splits much more often than usual, so your bidding decisions in situations like the one you faced need to be on the conservative side. I, personally, don't think your hand rates a 4
♠ bid, and I think any players who bid 4
♠ were way too aggressive. You might bid 2
♠ opposite partner's 1
♠ response to a one level take out double, but no more.
Finally, I think 4
♠ is not the greatest contract in the world. You have only SEVEN TOP TRICKS. The necessary three extras will have to come from suit splits or ruffing. Odds of a 3-2 spade break are less than the usual 68(?)%. I am guessing it to be 50-50 or less (if anyone has any real simulation data on this, it would be great to know). The odds of the heart suit coming in for four natural tricks is less than the normal 50-50 as well. The only good thing is that you are ruffing behind the short opponent in diamonds.
If you got a bad result for bidding 3
♠ for +170, I would just consider it a fix and move on.