That's a really big question--which you probably knew. It's on the leading edge of my philosophy; the shortest answer is that I don't have a policy answer for you yet. I have guidelines in place (the usual ethical boundaries), but for definitive substance the matter is awaiting my full consideration at a later date.
First of all, I hold to the position that it is unreasonable to expect that 100 percent of our species can escape the outcome of "total failure," and that's true regardless of the context. No species is 100 percent successful at the individual level at survival, procreation, and (where applicable) socialization. And how much more difficult a challenge are the standards of civilization itself, above mere survival. Quite apart from the fact that civilization requires thinking and behaving and is therefore hard in any case, the specific shapes we have given to our civilization guarantee that it will be a particularly irreconcilable match for some people. Some people can't be civilized. They're either mentally impaired or maladjusted (and sometimes both). In modern societies, these people often land in jail or institutions. In primitive societies, they tend to wind up dead. Sometimes they are cared for by family or friends, especially when their dysfunction is brief, but those caretakers who have the option usually end up transferring their charges to a professional facility.
An enlightened society, as I consider it, has three imperatives it must follow in accommodating these people. It must prevent causing them undue suffering, and it must alleviate undue suffering where it reasonably can. The third is that it must help dysfunctional people toward their aspirations where it is reasonable to do so. For humans, "mere" subsistence is rarely sufficient, and that extends into many people who are not able to function in society. The search for purpose applies to many of them, too.
For one thing, we need more and better institutions, funded better, and held to better standards. There are, thankfully, people who are better-suited and more willing than I am to work with the severely disabled. Given the title of this thread, now is a good point to note that conservatives don't understand and resent these kinds of social expenditures. What we're looking at is a monstrously expensive proposition--not on the order of welfare entitlements like Social Security, but up there with, say, roads funding. I would probably favor a dedicated "humanitarianism" tax that could be spent only on the welfare of those who are unable to function in society by themselves.
For another thing, we need to shed our social aversion to euthanasia so that we may supply assisted suicide to those who seek it for themselves. Many of these people have a desire to continue living, but many do not. We should let them decide this question without putting our fingers on the scale--either by mores or by laws.
The obvious next question is what to do about those who are so badly impaired that they have no quality of life at all, the people whose minds are infantile or whose bodies permit few or none of the sentient pursuits of life, or both--and who, in any case, cannot declare their intentions to the rest of us. My natural inclination is to say that, barring developments in medicine, we should euthanize them as well. But involuntary euthanasia is a policy I am always reluctant to support--and certainly never without excellent reason. The only alternative is to care for these people much like we would care for a laboratory specimen. Either way, there's no dignity in it. I suppose the deciding question for me would be whether these people possess personhood. Those who don't, probably should be euthanized. Those who do, but just barely, are the hardest to contemplate, because they fall into the uncanny valley and we do a lot of projecting and anthropomorphizing with regard to them. In the case of obvious chronic agony, I would lean toward euthanasia. In other cases, I have no opinion.
Now, so far I've talked about the people who can't function in society. First of all was them. But that's a very small slice of your question. There are also the people who can or could have functioned in society, but do not. And there are the additional requirements imposed upon the qualifier of a "perfect" society, which you imposed. So, second of all, I'll consider these elements in combination.
Many people have a hard enough time staying civilized even in a society as primitive as our own. This is and was true of every society. And, because such people are not typically outright dysfunctional so much as merely barbaric, they often acquire positions of power and corrupt our culture. This has been going on for as long as civilization has existed, and goes back even farther into our animal past where no blame can be assigned.
At the center of your question is this philosophical dilemma of the chicken and the egg. What is a perfect society without perfect people? What are perfect people without a perfect society? That's why I wouldn't use the word "perfect" like you did. I prefer qualifies such as "enlightened," "civil," "mature," or perhaps "Illuminated" if we're being orthodox in our adherence to Joshalonian philosophical precepts.
It begins with children. Children are like wood sculpture. We can shape them into almost anything, but they have an underlying grain and other physical characteristics which predispose them to being shaped a certain way. To be blunt, an enlightened society would not raise children the way we do it now, because too many grow up to become pigs or ants or sheep or vultures or dogs or lions. The odds of civilizing a child are vastly better than rehabilitating an adult whose ways are set. Most humans possess the cognitive toolkit for enough critical thinking to get them by in an enlightened society which places a premium on critical thinking. Nearly all humans possess both curiosity and ambition, the two of which must be encouraged healthily.
All children are born feral, with the same genetic instructions that our ancestors possessed before the first wooden plows ever dug in the dirt. The act of raising a child is literally the process of grafting our civilization onto them. (You might prefer a less negatively connoted word, such as "infusing.") Any and all flaws that exist either in the cultures themselves which are being grafted onto the child, or the people doing the grafting, can show up in the child. And children feel that genetic pull...to form social hierarchies, to become packs--or herds. The challenge is to satiate their restless energy without allowing them to evolve into barbarians. Despite the magnitude and exactitude of the challenge, we have the physical capacity to do it today. No further technology is required, although it would certainly help.
An enlightened society must raise children in accordance with Joshalonian ethics, which, after all, are not ethics created by me so much as humanistic truths expressed through me. We could as well say that an enlightened society must raise children humanistically, but that leaves open the question of what humanism entails. I prefer my brand, which is an open-minded brand that admits failure well and wears success well. But, whatever the brand, the sorts of things we need to be teaching children are critical thinking, factual knowledge, thoughtful behavior, resourcefulness, etc., etc. Schools as they exist now focus primarily on academics, often to the exclusion of other, pragmatic areas relevant to a child's life. I suppose it is assumed that parents are supposed to be the teachers of those qualities, but parents today are falling short even worse than schools.
An enlightened society, I think, must fulfill three basic obligations in the education of a child, each of which is a prerequisite to that child becoming civilized as an adolescent and then an adult. The first is that children must learn to become independent and resourceful, and must value so being. This positive mindset inoculates people against the victim mentality which is so expensive on our social welfare system and so detrimental to our cultural development. Children need to understand that they need to live and act for themselves, that they shouldn't wait for somebody else to do it all for them, that they are significant and can become powerful in the ways they want to become powerful. The second is that children must learn the importance of humane behavior toward all beings capable of suffering, and stewardship over all the Earth. There's a lot of cruelty that comes naturally to us because of our heritage, which is then reinforced for many kids because of their specific upbringing. Children need to come to fear, and eventually abhor, the infliction of needless destruction upon anything. The third is that children must learn civilization itself--our technology, our history, our art. We are alone in the voyage of human history, separated from those who came before us and those who will come after us. Our only companions are, by chance, those who were born with us in our own time. Our experience of the social aspect of civilization will exist through them. They are our fellow travelers on a ship whose ocean is much vaster than we will ever see. No one can fully comprehend the legacy of the great human enterprise without understanding where we have already been, where we are now, and, therefrom, determining where we should like to go. Every generation gets its chance to touch the wheel. If you are invested in the human future, as I am, it is of the utmost importance that we teach our children to navigate well. They must know the ship and know the sea, and know their company. A society's great challenge on this point, then, becomes the distillation of vast quantities of history, science, technology, humanities, mathematics, and art into a useful factual education.
I was thinking about that last night: Maybe I should compile a reference for that, myself. It would be the work of years, and I think you would be well-suited to help. Thankfully, a lot of salvageable work has already been done for us, but the rest is up to us--or else somebody else will do it. Shudder.
When children grow up defective, they can be expected to misbehave. This is another point conservatives (and most people) do not understand. Their misbehavior is only partially their own fault. It is hypocritical to punish them but not their corruptors. And, really, "punishing" them ought to be reserved. A strong penal system must consist of rehabilitation, deterrence, and punishment. Our American model focuses on the last part to the near exclusion of the other two. Our incarceration rates are disgusting when compared with those of other countries. These are people who are being permanently ruined in our overcrowded, dangerous prisons where every bad culture from which we would protect our children thrives. If you rob a liquor store, you ought to be on the hook for the property you destroyed or stole, and for the injury you caused--if any. Much of the time, I don't see how that reasonably translates to letting somebody rot in prison--probably joining a gang, getting raped, becoming an addict, and being denied the pursuit of self-enrichment along the way.
When it comes to children who have fallen through the nets and have become troublemakers in their adolescence or adulthood, an enlightened society must strive to discourage them from making further trouble, and rehabilitate them from that which motivated the troublemaking in the first place. Only rarely is a crime so heinous that we ought to kill a person for it. Sajainta's revelations tell us about such people. More controversially, we can anticipate that some people who have not yet committed such crimes eventually will, if given the opportunity, and we should treat them more severely than ordinary scofflaws. But as for the majority of fallshorts, those whose crimes are beneath the mandate of severe or prolonged punishment, I think everyone should get the chance to reclaim their freedom speedily.
Many people who are set in their ways do not have the willpower to resist a change of worldview imposed from without. I'd like to see a new kind of schooling emerge, one which teaches to lapsed adults that which they did not learn as children. With one-on-one attention, we could probably cure most people of their destructive political views or religious fundamentalism, as well as more primitive failures such as misanthropy and gang mentality. The "how" of it would vary greatly between individuals, but most people's obstinacy can be cracked. Christianity has taught us that much, with its potent system of rewards and punishments. Every person has things they want and things they don't want (not counting all those things from either category of which they are not yet aware). A lot of criminal behavior stems from the mindset that one is immune to the social order, above it, or is mistreated by it. The first two mindsets can be counteracted by humility, and the latter by kindness. It's an obvious next step to bring these two ideas together, and shape people's behavior by tempting them with what they want and threatening them with what they don't.
When dealing with misfits, the first chapter of rehabilitation is not to groom them for Illumination, but to kindle their respect for the social order. Some people will answer to fear. Others will answer to opportunity. Others still will answer to plain old compassion. And, of course, combinations abound. Criminals are rarely philosophers. They can be forced, manipulated, lured, and enticed into a more positive worldview, and with the right approach their resistance will usually falter. Then, later on, looking back, they may be able to appreciate the good that it did them to be cajoled away from their old views. I suggest that we should reserve the power to treat these kinds of people like children, where their behavioral problems are the result of childish thinking. Separately, many people can be brought back from the brink simply by showing them that the world is not as bad a place as they thought. An enlightened society could do that much more easily then ours can, because our society often does push people into lives of crime and misbehavior.
And an enlightened society will improve upon itself, so that its failures become fewer and fewer.
An enlightened society must not impose upon all its denizens the obligation to excel, for by definition few can, but merely to succeed. It's okay if some people live lives of mediocrity, so long as they were given the opportunity to pursue their ambitions and were able to taste some victories along the way. Even the greatest among us can not hope for much more than that, excepting that the scope of their victories would have been grander. One reason so many fictional utopias are strawmen is that they hold their denizens to unrealistic expectations. A truly enlightened society will have Homer Simpsons in it and should offer those people their own slice of the pie. Aesthetically, artistically, recreationally...the ideal society will look very different from person to person. Such a society must become transparent in these ways, allowing individual interpretation to dominate, and materializing only to make sure that we are all well-accommodated.
To summarize, then, my answer to your question:
1. I don't have specific policies yet because my philosophy has not yet given full consideration to the issue.
2. The severely disabled must be treated humanely and given opportunities to pursue life within their limitations, or be euthanized.
3. Children must be taught how to prosper in an enlightened society.
4. Those who fall short, misfits and maladapts, should be reeducated, rehabilitated, and shown compassion and opportunity.
5. Society must improve upon itself so as to better accommodate all individuals.