Bret Spiner does not play the Riddler in Justice; the Riddler in the Justice project associated with Spiner is voiced by someone else, and Spiner's connection to that DC animated work is a different role entirely. To be precise about what is and isn't established, it helps to pin down which "Justice" is meant, because the query's phrasing is ambiguous and the answer changes depending on the title.
What "Justice" most likely refers to
The most plausible referent is Justice League Action, the 2016–2018 Cartoon Network animated series, in which Brent Spiner voiced the Riddler. Note the name: Brent Spiner, not "Bret." The Riddler appears in that series as a recurring Batman villain, and Spiner—best known as Data on Star Trek: The Next Generation—was part of its voice cast. If someone remembers "Spiner as the Riddler" and shortens "Justice League Action" to "Justice," the underlying memory is essentially correct for that series, but the shorthand drops the actual title.
The confusion is easy to understand. "Justice" alone is not a standard title for a DC animated series. There is Justice League, Justice League Unlimited, Justice League Action, Young Justice, and the animated films under the Justice League banner, among others. A person hearing or reading a fragment like "Spiner … Riddler … Justice" can reasonably reconstruct it as "Justice," but that reconstruction merges a real casting fact (Spiner voiced the Riddler in Justice League Action) with an imprecise title.
What is not the case
Spiner does not appear as the Riddler in Justice League (2001–2004) or Justice League Unlimited (2004–2006). The Riddler's appearances in those series are not Spiner performances. Nor is there a live-action Justice film or series in which Spiner plays the Riddler; no such production is established. If the question is whether Spiner physically portrayed the Riddler—costumed, on camera—in any Justice-titled work, the answer is no. His Riddler is a voice performance in an animated television series.
There is also a separate source of confusion worth naming: "Justice" can suggest Justice League (the 2017 live-action film) or the Snyder Cut, Zack Snyder's Justice League (2021). Neither features the Riddler at all, and Spiner is not in either. So if the query is really about those films, the Riddler doesn't appear, and the question of who plays him is moot.
The distinction that resolves the question
The clean way to hold this is to separate three things:
The performer: Brent Spiner, the actor. The role: the Riddler (Edward Nygma), a Batman rogues-gallery character. The title: Justice League Action, an animated series, versus other Justice-named works.
Spiner + Riddler is a real pairing, but only within Justice League Action. "Justice" as a standalone title is not where that pairing lives. The accuracy issue is therefore a title-precision issue, not a casting issue: the casting memory is right, the short title is wrong.
Why the shorthand causes trouble
In casual fan conversation, long animated titles get truncated. Justice League Action is a mouthful, and "the Justice show" or "Justice" is a natural abbreviation. But because Justice League and Justice League Unlimited are far more famous, "Justice" tends to be read as those instead—and in those, the Riddler is voiced by other actors across his appearances. The result is a plausible-sounding but incorrect claim: "Spiner played the Riddler in Justice." Corrected, it becomes "Spiner voiced the Riddler in Justice League Action."
A second layer: voice versus live action. Spiner is strongly associated with live-action genre television, so a listener may assume any Riddler role he had was on camera. It wasn't. Animated voice casting is its own record, and conflating it with a live-action film credit produces further error.
What can and cannot be confirmed here
What is answerable from stable knowledge: Spiner voiced the Riddler in Justice League Action, and he did not play the Riddler in Justice League, Justice League Unlimited, or the live-action Justice League films. What cannot be asserted with confidence here is the exact episode list or the full scope of the Riddler's appearances in Justice League Action, because no retrieved evidence is available and such details should be checked against the series itself or a reliable episode guide. The core answer—no, not in "Justice" as such, but yes in Justice League Action—does not depend on that finer detail.
If the intent was a different "Justice"—a comic titled Justice, a specific animated film, or a fan production—the answer would need that title identified, because "Justice" by itself does not uniquely name a work.