To me the most probably one is that Lenk, believing or wanting to believe that Avery was guilty, took steps to "help" his investigation along.
It is known that this sort of practice is ... sadly ... altogether too common where zealous (or overzealous) cops and prosecutors are concerned.
I suspect that the nature of the job lends itself to that. They are often the type who cannot conceive that they might be wrong once they have made up their minds about something.
When personal interests and advantages are added to the mix, e.g. a desire on Lenk's part to achieve some sort of exoneration of his own, "See, I told you Avery was a bad guy.", or rep. building by a DA (Are they elected in that jurisdiction?), it becomes trivially easy for someone to justify such actions in their own minds.
After all, it isn't like they were framing someone who wasn't guilty of something.
And they have certainly demonstrated their cheerful willingness to frame someone they had no reason to believe was guilty of anything at all.