They had to open the gates to relieve the crush that had built up as they didn't funnel fans properly along Leppings Lane, as the operational plan required.
The plan also called for the monitoring of the central pens and required police and stewards to block the tunnel leading to those pens, directing fans to the outside pens. I've seen the video taken after the disaster and you almost certainly wouldn't find those entrances if you were looking for them. So closing off access to the central pens was vital if they were at or over capacity.
Duckenfield, in the Control Room, could see that those central pens were at capacity well before kick off. He failed to react despite a number of messages being relayed to him about the situation. Eventually, he acceded to the demand of thr police outside the stadium to open Gate C but didn't instruct them to stop fans accessing the tunnel to the central pens. When the disaster occurred, and the scale became clear, he told his superiors that fans had forced open the gate, in order to save his incompetent, negligent, lying skin. He should have gone to prison but coppers often seem, like Liverpool fans, to be immune to the consequences of their actions.