Short answer. Exclusively the owner on whose side the removed earth was piled. Article 661 of the Civil Code presumes a ditch between two estates is common to both, unless there is a title or sign showing otherwise, and having the excavated dirt on only one side is exactly that kind of sign, giving exclusive ownership to the owner of that side.
What the law says
Ditches or drains opened between two estates are also presumed as common to both, if there is no title or sign showing the contrary. There is a sign contrary to the part-ownership whenever the earth or dirt removed to open the ditch or to clean it is only on one side thereof, in which case the ownership of the ditch shall belong exclusively to the owner of the land having this exterior sign in its favor.
Civil Code, Article 661 — Ditches and Drains Between Estates. Read the full provision →
The general presumption of common ownership
Article 661 starts from a default assumption favoring shared ownership: ditches or drains opened between two estates are also presumed as common to both, if there is no title or sign showing the contrary. Absent evidence pointing the other way, a ditch running along the boundary between two properties is treated as belonging to both neighboring owners together, rather than exclusively to one or the other.
Why piled earth on one side overrides that presumption
Article 661 identifies a specific physical fact that rebuts the presumption of common ownership: there is a sign contrary to the part-ownership whenever the earth or dirt removed to open the ditch or to clean it is only on one side thereof. Where the excavated soil sits entirely on one owner's side rather than being spread on both, that pattern itself is treated as evidence about who actually dug or maintains the ditch, and the law reads it as pointing to exclusive ownership on that side.
What this sign actually establishes
Once this exterior sign is present, meaning the dirt is found only on one side, the article is direct about the consequence: the ownership of the ditch shall belong exclusively to the owner of the land having this exterior sign in its favor. This flips the outcome entirely, from presumed shared ownership to exclusive ownership by just one neighbor, based purely on which side the excavated earth was placed, without needing any separate title document to establish that ownership.
What this means in a practical boundary dispute
If you are trying to work out who owns a ditch between your property and a neighbor's, Article 661 makes the location of the excavated earth directly relevant evidence: dirt piled on only one side points to exclusive ownership by the owner of that side, while dirt on both sides, or the absence of any such sign, supports treating the ditch as commonly owned. A title expressly addressing the ditch's ownership would still control over this sign-based presumption, but where no such title exists, this physical evidence is what the article looks to.