I'm not sure how its Kirk's responsibility that Starfleet installed faulty hardware/software on his ship?
That's something that an inquiry finds out later, but captains have historically been held responsible for everything
that happens on their ship (including the loss of their ship). If the inquiry finds out that there was nothing
the captain could have done, then the captain is cleared. It's standard procedure in most instances, IMO (I think Picard faced an inquiry following the loss of the Stargazer
, was found not at fault, and then went on with business as usual).