There's a few different things going on here. First, to get it out of the way, we've known that gout was linked to lifestyle since the beginning of medicine. No less a person than Hippocrates made this connection:
Hippocrates also noted the link between the disease and an intemperate lifestyle, referring to podagra as an 'arthritis of the rich', as opposed to rheumatism, an arthritis of the poor. Six centuries later, Galen was the first to describe tophi, the crystallized monosodium urate deposits that can follow longstanding hyperuricemia. Galen associated gout with debauchery and intemperance, but also recognized a hereditary trait [3] that had previously been referred to by the Roman senator Seneca [4].
Now the first thing to realize is just because people tell you that something is bad for you, does not mean that people will stop doing it. It is trivial to find behaviors we know for a fact damage your health that millions of people still do.
But with that out of the way, we now know that gout is caused by foods high in purines. That connection was never made so specifically. Why? This is likely due to the cultural biases of Europe in those eras. (Gout is mostly a European disease due to differences in diet between Europe and other regions.) In Europe, there have been generally two overarching theories about why people get sick.
The four humors. The ancient greeks saw illness as an issue of the four difference substances that power the body being "out of balance". For them, this would be the cause of all disease, including gout. So they would generally look for ways to put the humors in balance. They were more likely to give you a purgative or bleeding.
Religion. The church saw at least some illness as punishment from God. The way to the cure was prayer, and, of course, to stop sinning. Ironically, this would likely be more effective than the "scientific" four humors at stopping the actual disease as it would blame the "intemperance" of heavy eating and alcohol.
This irony shows clearly why scientific advancement is so hard. As Pieter Geerkens points out in the comments, there is a disease called hemochromatosis where the modern treatment is bleeding, in common with the sorts of treatments someone operating on the four humors paradigm might prescribe. So basically theories that are wrong can still lead to results better than chance.
So consider if you're a medieval doctor: You have two theories of disease. Both work in some cases. You have no alternate theory. In that situation, you can easily be misled to believe that those two theories are correct. In other words, these weren't irrational, superstitious people making wild-ass pointless suggestions. These were rational people, making suggestions based on the current best theories about how the way the world operated.
It takes a particular sort of person to create entirely new theories of the way the world works. There were many intelligent, rational people in the 17th century, but only one Isaac Newton.
It was only after these two theories of medicine lost their dominance that Europeans were able to see past to the idea that particular foods have particular effects. Remember, scurvy was rampant until the 19th century, and the dietary connection there is quite a bit easier to make than with gout. This was very difficult, because those older theories were quite entrenched by millennia of practice and, yes, success.
Interestingly, when I was researching this, I ran across this paper, which talks about an Islamic physician, Abu Bakr Mohammad Ibn Zakariya Razi, who while still operating in the "four humors" realm, offers relatively good advice:
“Gouty patients should forsake camels meat, beef, namaksud (salted jerked meat), as well as died game meat and all kinds of jerked meat. As regards fish, it is advisable to avoid all kinds of salted fish, as well as stinking rigid-flesh unsalted fish. Dairy products should be all forsaken except for small amounts of milk, cooked with rice and sprinkled with pinch of tabarzad (solid white sugar) sugar
How many of his patients followed that advice when it is time for dinner, who knows. My doctors tells me I need to lose weight and drink less, but there's a Russian Imperial Stout in the refrigerator that is calling to me...