Odd. My horses supposedly have great hooves. The farrier last week told me it was like trimming granite. No lung issues that I've noticed. There would be no horses in southern Arizona - well, almost none - if horses needed pastures to run in.
If you keep your horse in knee-deep poop, or a small marsh...that is another story. But I can go thru a stable that has 20x20 stalls and less, and see healthy looking horses complete with muscles and decent feet, waiting to be ridden.
The question wasn't, "What is an ideal situation?", but 'what is needed?' - and they do not NEED a large pasture with room to run free and large social groups to act like healthy, content horses.
I'm pretty well convinced that people function best if they live on 160+ acres and do manual labor much of each day. I have two acres & go jogging & riding. But lots of folks live in Hong Kong without contemplating suicide...
Stalling a horse or keeping one in a small paddock does not guarantee they will have bad hooves - and no one said it does. I have smoked for 45 years and have neither lung cancer nor a bad heart. The fact remains, and it is a fact, that confined horses have a higher incidence of hoof issues, lung issues, and cribbing, weaving, and other emotional issues, just as smokers have a higher incidence of heart disease and lung cancer. I risk compromising my health by smoking, and if you confine a horse, you risk compromising its health as well.
The OP's question was "Do horses need to be pastured"? No, they don't...theoretically you could keep one in a 2 X 6 chute, and as long as they are fed and watered they would likely survive. However, the very nature of the question indicates the OP is a novice, and should receive the best possible advice, which is...anything less than 24/7 turnout in a large area compromises the environment a horse's anatomy and physiology mental state,and instincts are designed for - excepting those cases where a horse has issues that dictate confinement or circumstances to protect a horse, such as from severe weather, dictate confinement.
Most horses are fairly adaptable and will adjust to and accept confinement, but confinement is for the convenience of man and the circumstances of the owner - it is NOT in the best interest of their health.
A horse can live strictly on grain - but its digestive system is not designed for that diet, which most of us know, so we pasture and/or hay them.
A horse can survive without vaccinations or hoof trimming or deworming - at least for a period of time, which most of us know so we act accordingly.
Those who think it is OK to confine a horse are merely rationalizing to justify their inability to provide an adequate environment. I am not criticizing those people - not everyone can provide an adequate environment, and people have a right to do as they choose. But let's call a spade a spade here, and not give a beginner the idea that confinement of a horse - or any animal - is in any way desirable...confinement introduces potential physical and mental health risks, and that is just a fact of life...