Bach is supposed to be the master of all things music, but in the first fugue of the WTC (BWV 846), there seem to be a lot of counterpoint errors and voice leading errors. In the Urtext edition, there is direct motion to an octave in bar 8 beat 2 (C# and A to a D octave), false relations in bar 18 beat 1 (B in second voice followed by Bb in first voice), and a few more. Since Bach is the master of this style, there would usually be a reason for this, but there doesn't seem to be any. Why are there these voice leading errors, and why did Bach tolerate them?
Notice that in both of these cases, the voice leading is constrained by the shape of the fugue subject.
[Hidden consecutives are] sometimes permitted under certain conditions, such as the following: the interval does not involve either the highest or the lowest part, the interval does not occur between both of those extreme parts, the interval is approached in one part by a semitone step, or the interval is approached in the higher part by step. The details differ considerably from period to period, and even among composers writing in the same period.
It this case, the interval does not involve the soprano, only the bass, and the bass moves by half step.
As to the false relation, the prohibition is not as strict as you suppose. They are indeed rare in traditional Fuxian counterpoint, but this is not a Fuxian subject: note the three consecutive leaps. Such leaps are more instrumental in character than vocal; one use of this technique is to imply two independent voices by alternating between them (for example, the second measure of the third fugue).
I could not find a good reference for this, but often in this context of instrumental figuration with leaps of this sort, the rules are relaxed. In fact, combining this kind of figuration with rising or falling chromatic line more or less guarantees false relations. Some examples:
B minor mass, Et incarnatus est: m. 8 beat 3, tenor D3; m. 9 beat 1, alto D♯4 (also soprano B4 to bass B♯2, but the orchestra bass has B2 in the first chord, so it moves by half step).
B minor mass, Crucifixus: many entrances on F♮ on the second beat of the second measure of the ostinato, where the first beat has a D♯ in the bass and therefore an F♯ in an upper part (one of these Fs is the first note of an ascending melodic augmented second).
Toccata and Fugue in D minor, m. 100: beat 1, E♭5 in the soprano; beat 2, E♮3 in the tenor; the contrapuntal texture here is reduced to two voices.
(Compare "And With His Stripes" from Messiah, where the ascending chromatic line stops jumping around, so it stays in the same voice rather than creating false relations.)
In looking for these examples, I also noticed that the Badinerie from the B minor orchestral suite has several instances of parallel unisons between the solo flute and the second violin.
The "rules" of counterpoint are not strict; rather, they are extrapolated from the general practices of prominent composers — Palestrina, in particular. When taught to students, they are taught strictly — in order to help the student be detailed in their approach to counterpoint. But in practice the rules are not so strictly applied, and the general reason is "it sounds okay". That is to say, the rules of counterpoint (which typically means "as laid out by Fux", since there was no textbook set of rules that Baroque composers were operating from) are set up to preserve independence of voices and to avoid situations that sound "bad" according to the tastes of the time. Also keep in mind that the rules were developed based on an earlier style — Palestrina's — in which the chromatic complexity of Bach didn't exist. They were developed out of the modal tradition of counterpoint rather than the tonal one that was emerging in Bach.
Similar themes — "suggestions" vs. "rules"; "master composer breaking rules" vs. "student adhering strictly to them" — are at play in Why do the parallel fifths work in Schumann's Op. 15 No. 1?
Music is not the same as writing/solving a Sudoku game. Not even for Schönberg's serial music. And here we are looking at Bach's music in the baroque tradition. You call Bach a "master of this style", and that is the essence of your answer already: it is a style, intended to convey an impression on the listener, not on an analyst. The WTC contains 4-part fugues and consequently more complex works than the 2-part inventions and 3-part symphonies. At the same time, they show thematic progression and density as well as idiomatic development of each piece and an overarching structure and character of the conglomerate.
And more often than not, Bach was working under significant time constraints. He did not earn a living from royalties but was paid for a constant stream of new compositions and performances, fitting a few works of passion in between.
So it's really more a case of him prioritising other goals over sticking absolutely with rules even in cases where the gains for judiciously breaking some of them warrant not starting over but rather finishing in style.
The rules of counterpoint are as important for a composer in the baroque time as the rules of perspective are for a painter. You don't check the latter with a ruler but with the spectator's vision. An Escher painting conveys perspective and geometry even though it violates the rules of perspective and geometry. Bach does not play with the rules like Escher does, but neither does he sacrifice the musical sense in their service, and, depending on the work, he may accumulate a lot more of complexity than a strict adherence would allow for while still maintaining thematic development.
Also note that Bach's reputation at his lifetime was well-respected but not particularly stellar: his comparatively free interpretation of the rule set was not met with the appreciation he now enjoys.