After all, Alastor Moody was locked into a trunk for the whole year in Book 4 (Harry Potter and the Goblet of Fire). Seeing this, Dumbledore should realize that Alastor Moody's duelling skills have gone rusty, and he’s no longer able to protect himself. Why did Dumbledore allow Alastor Moody to join the reconstituted Order of the Phoenix in Book 5?
First of all, it was not exactly easy to get people to join the Order. Dumbledore may have been willing to take virtually anyone he could get. Consider first the following description:
“You see the problem,” said Lupin. “While the Ministry insists there is nothing to fear from Voldemort, it’s hard to convince people he’s back, especially as they really don’t want to believe it in the first place.
Even if you could find people who believe that Voldemort is back, it would still be hard to get them to join the Order. Some people like Slughorn in the beginning of Half-Blood Prince are afraid to align themselves against Voldemort:
"Still... the prudent wizard keeps his head down in such times. All very well for Dumbledore to talk, but taking up a post at Hogwarts just now would be tantamount to declaring my public allegiance to the Order of the Phoenix! And while I'm sure they're very admirable and brave and all the rest of it, I don't personally fancy the mortality rate –"
We know that in the first war the Order was heavily outnumbered by Death Eaters. Therefore, pretty much anyone who can produce magic and is at least somewhat loyal to Dumbledore is an asset. Moody certainly fulfills both of those criteria.
Additionally, it is not so obvious that Moody was worse than the other members that Dumbledore allowed into the Order. The circumstances that led to Moody being locked in the trunk were hardly favorable to him. He was the victim of a surprise 2-on-1 attack, and despite that, he still put up a valiant fight. From Barty Crouch Jr.'s testimony at the end of Goblet of Fire:
Moody put up a struggle. There was a commotion. We managed to subdue him just in time.
Also, losing a duel does not make someone unfit to be in the Order. Various other members of the Order also lost duels or were overpowered; some were even killed:
Harry saw Kingsley, yelling in pain, hit the ground. Bellatrix Lestrange turned tail and ran as Dumbledore whipped around.
A jet of green light had narrowly missed Sirius; across the room Harry saw Tonks fall from halfway up the stone steps, her limp form toppling from stone seat to stone seat, and Bellatrix, triumphant, running back toward the fray.
Only one couple were still battling, apparently unaware of the new arrival. Harry saw Sirius duck Bellatrix’s jet of red light: He was laughing at her. “Come on, you can do better than that!” he yelled, his voice echoing around the cavernous room.
The second jet of light hit him squarely on the chest.
The laughter had not quite died from his face, but his eyes widened in shock.
Harry had a clear view of the bodies lying next to Fred: Remus and Tonks, pale and still peaceful-looking, apparently asleep beneath the dark, enchanted ceiling.
"Of course I'm sure... he's a – bit of a mess, that's all. Greyback attacked him. Madam Pomfrey says he won't – won't look the same anymore...."
Hermione, Parvati, and Lavender all screamed. No fewer than four Stunners had shot from the figures around the cabin toward Professor McGonagall. Halfway between cabin and castle the red beams collided with her. For a moment she looked luminous, illuminated by an eerie red glow, then was lifted right off her feet, landed hard on her back, and moved no more.
- Emmeline Vance
It led, as perhaps you have guessed, to the recent capture and murder of Emmeline Vance,
- Members of the first Order
Benjy Fenwick, who had been found in bits, and Gideon Prewett, who had died like a hero, and the Longbottoms, who had been tortured into madness
Note also that even people who are useless or almost useless in battle are still in the Order. For example, Mundungus and Mrs. Figg.
Most importantly, even after Moody's year in the trunk he was still considered the most powerful member of the Order after Dumbledore died:
"You-Know-Who acted exactly as Mad-Eye expected him to," sniffed Tonks. "Mad-Eye said he'd expect the real Harry to be with the toughest, most skilled Aurors. He chased Mad-Eye first, and when Mundungus gave them away he switched to Kingsley...."
Also, even if we were to grant that Moody was past his prime in terms of doing actual fieldwork, no one can deny that he has tremendous experience which may be useful. He was probably the most successful dark-wizard-catcher alive at that point, and he could certainly offer advice and helpful tips to the younger or less-experienced members. Let's not forget the great tip he provided in the beginning of Order of the Phoenix:
Harry descended the stairs, very conscious of everybody still staring at him, stowing his wand into the back pocket of his jeans as he came.
“Don’t put your wand there, boy!” roared Moody. “What if it ignited? Better wizards than you have lost buttocks, you know!”
“Who d’you know who’s lost a buttock?” the violet-haired woman asked Mad-Eye interestedly.
“Never you mind, you just keep your wand out of your back pocket!” growled Mad-Eye. “Elementary wand safety, nobody bothers about it anymore...” He stumped off toward the kitchen. “And I saw that,” he added irritably, as the woman rolled her eyes at the ceiling.
Another unique quality that Moody brings to the Order is his magic eye. Even if he would never take part in a duel, this would still be useful. For instance, in the beginning of Order of the Phoenix he was able to use it to see what was in the writing desk that no one wanted to open without knowing its contents:
“Oh, Alastor, I am glad you’re here,” said Mrs. Weasley brightly, as Mad-Eye shrugged off his traveling cloak. “We’ve been wanting to ask you for ages — could you have a look in the writing desk in the drawing room and tell us what’s inside it? We haven’t wanted to open it just in case it’s something really nasty.”
“No problem, Molly …”
Moody’s electric-blue eye swiveled upward and stared fixedly through the ceiling of the kitchen.
“Drawing room …” he growled, as the pupil contracted. “Desk in the corner? Yeah, I see it... Yeah, it’s a boggart... Want me to go up and get rid of it, Molly?”
Being captured wasn’t necessarily evidence Moody lost his skill.
Though Moody was captured, this doesn’t mean he lost his skill in dueling or defending himself. He’s skilled, not invincible, and even powerful wizards can be defeated. When Barty Crouch Jr. recounts how Moody was captured while under Veritaserum, he says Moody put up a struggle.
“Wormtail and I did it. We had prepared the Polyjuice Potion beforehand. We journeyed to his house. Moody put up a struggle. There was a commotion. We managed to subdue him just in time. Forced him into a compartment of his own magical trunk.”
- Harry Potter and the Goblet of Fire, Chapter 35 (Veritaserum)
Moody fighting Barty Crouch Jr. and Wormtail but still losing isn’t strong evidence that he’s become incapable of defending himself. Moody was never said to be invincible.
Also, there was no reason not to let Moody stay in the Order.
Even if Dumbledore was concerned Moody wasn’t going to be as skilled in battle as he used to be, there’d be no reason to remove him from the Order entirely. After Moody was captured, he would still be able to contribute usefully to the Order, even if it was in other ways than in duels. For example, he’s part of the group guarding Harry as the Order takes him to King’s Cross.
“A porter’s cap pulled low over his mismatched eyes, Moody came limping through the archway pushing a trolley loaded with their trunks.
‘All OK,’ he muttered to Mrs Weasley and Tonks, ‘don’t think we were followed …”
- Harry Potter and the Order of the Phoenix, Chapter 10 (Luna Lovegood)
One of the things Moody seems to do for the Order is help plan things that need to be coordinated, like when they need to move Harry or keep him safe. He could do that still, even if his dueling skills were in question. He also does take part in further battles, like the one at the Ministry of Magic.
“Then, high above them, two more doors burst open and five more people sprinted into the room: Sirius, Lupin, Moody, Tonks and Kingsley.”
- Harry Potter and the Order of the Phoenix, Chapter 35 (Beyond the Veil)
He was in the original Order, so Dumbledore likely trusts him. Even in the event that he was proven incapable of defending himself, it’s unlikely he’d be removed, though his duties might be changed.
“There’s me,’ said Moody, unnecessarily pointing at himself. The Moody in the picture was unmistakeable, though his hair was slightly less grey and his nose was intact.”
- Harry Potter and the Order of the Phoenix, Chapter 9 (The Woes of Mrs Weasley)
If Dumbledore was particularly concerned about Moody’s ability to defend himself (which isn’t necessarily a reasonable conclusion from his being captured) he’d have no real reason to remove him from the Order. Many of the other Order members never had been skilled in battle. Elphias Doge, Hestia Jones, Dedalus Diggle, and Arthur Weasley are all in the Order, but aren’t said to have particular dueling skill. In addition, Arabella Figg is in the Order, and she’s a Squib, so she can’t do any magic at all. It isn’t required (though of course it’s useful and likely appreciated) that every Order member must be sufficiently skilled in battle or they’ll be asked to leave.
Even though he was slightly eccentric towards the end of the books, he was unflinchingly loyal and was always cautious. Here are some quotes about Mad-Eye's devotion and experience when it came to keeping himiself and others safe and knowledge of Death Eaters.
"Are you quite sure it's him, Lupin?" he growled. "It'd be a nice lookout if we bring back some Death Eater impersonating him. We ought to ask him something only the real Potter would know. Unless anyone brought any Veritaserum?"
- Harry Potter and the Order of the Phoenix, Chapter 3 (The Advance Guard)
Here we see that he was one of the most experienced aurors.
"Half the cells in Azkaban are full because of him. He made himself loads of enemies, though...the families of people he caught, mainly...and i heard he's been getting really paranoid in his old age. Doesn't trust anyone anymore. Sees Dark wizards everywhere."
- Harry Potter and the Goblet of Fire, Chapter 11 (Aboard the Hogwarts Express)
Furthermore, Mad-Eye was an old friend of Dumbledores, so he might have been more willing than others might have been to allow him into the Order.
"He's an old friend of Dumbledore's, isnt he?"
- Harry Potter and the Goblet of Fire, Chapter 11 (Aboard the Hogwarts Express)
Finally, he made a good leader and was willing to make the ultimate sacrifice for Harry.