If some people voluntarily decide to submit to the judgment of a few individuals forming an informal "court", that's fine. I think the real question is what courts are encompassed by the country's legal system and have the power of law. Let me give you the American formula as an example.
There are Beth Dins in America. Their directives have no force of law, and their decisions are not part of the American common law. Although, like all religious organizations, they are exempt from paying taxes, Beth Dins are not funded by the public otherwise, like courts are. They are funded by their own communities, and their own litigants. Quite simply, they aren't part of the court system.
If two parties voluntarily agree to a binding arbitration, they can pick whatever arbitrator they want -- it can be a private arbitrating company, such as AAA, or a religious court. BUT -- ALL parties have to AGREE to refer the case to that arbitrator (a secular civil court may not simply refer them to a religious court), and the decision itself must comply with secular laws and public policy (no stonings for adultery, or anything like that). Even if the parties agreed to arbitrate a case in a Beth Din, and the Beth Din issued a decision, that decision must still be confirmed by a directive of a secular court before a law enforcement official will enforce it -- you can't just take a piece of paper from a Beth Din to a local sheriff and expect that sheriff to carry out its orders.
Bottom line -- having religious "courts" per se is not a problem. It's when religious courts become part of the "official" legal system, when religious adherents are automatically referred to them; when secular courts are obligated to defer to their judgments; and when the public executive branch is subjugated to such courts -- THAT's a problem.
In the United States, the First Amendment was interpreted very early on to proscribe public funding for religious institutions (other than tax-exempt status), or governmental "entanglements with religion". At the same time, the Seventh and the Fourteenth Amendments would prohibit an involuntary referral of a litigant to religious court. That pretty much precludes binding, "official" Sharia courts in this country. Barring, of course, at least two radical Constitutional amendments, which would be a tall order indeed, even for the supposedly "fasted growing" religion.