Sadly, yes, I do buy ill-fitting shoes - maybe not consistently, but often enough that it bothers me. My issue is, as another poster mentioned, finding the shoes comfy when I try them on and then OMG NOT COMFY when I actually try to wear them for a few hours.
What has helped me:
Learning which styles are easier on my feet e.g. if I'm buying flats, real leather just doesn't work for my feet - I'm better off getting softer non-leather flats from Target or similar. Mary Janes are easier on my feet than flats or other 'feminine' shoe styles.
Understanding that some styles of women's shoes are simply NOT made for walking. Most shoes that are appropriate to wear in the office (for me, this means flats because I'm not a heels kinda girl) are sadly not also appropriate to wear on the 4km walk home. So, I wear sneakers for my walk and switch to cute flats at the office. This also lowers the overall cost of your shoes, as you're not causing much wear at all to the pair you wear at work (could be different for you, lifejoy, as I know you're on your feet a lot more than I am!). I have Merrell mary janes which are good for walking and look nice with smart casual clothes, which I can wear on my days off for example if I'm going to walk to a coffee shop to meet a friend.
Understanding that my feet won't ever be happy with wearing the same shoes for days at a time. Even the best shoes will make them hurt after a few days of consecutive wear. So, I switch it up a bit. This requires you to own a few more pairs, but you'll take longer to wear them out. Switching between different pairs for my commute versus office outfit helps with this too. Shoes will also wear better if you let them rest, so you'll find that your shoes are happier if they're getting days off, too (this is a 'thing' with natural materials, can't guarantee that it's the same for plastic shoes).
Foundation garments for my feet (yes, really). I wear injinji toe socks under my tights (they're not visible through black tights) and that helps keep my feet comfy. Also, I'm much more likely to have issues with any shoes if I'm trying to wear them without socks and/or tights, so layering up helps make uncomfy shoes comfy again. This is especially important when wearing shoes in / stretching them out.
Last but not least - have friends with similar sized feet so that if you end up not wearing a certain pair, you can pass it on to someone who will love it :-)