Interestingly, they now can: under the Free File program, tax prep companies would offer free filing (for taxpayers below 72k AGI) and the IRS would not compete with their service.
After a ProPublica investigation in their dark pattern shenanigans (leading to about 3.5% of taxpayers to use the program when 70% are eligible) confirmed by the HSGA Senate Committee and NYS DFS, the IRS both updated its rule to preclude e.g. hiding Free File programs for search engine, and removed the rule which prevented them from competing.
Sadly the IRS has been hamstrung time and again by the GOP, both financially and politically. They can't even do their core jobs of collecting tax and auditing the taxpayers they need to, so it's unlikely they'll have the clout and funds to set up a free filing program any time soon, let alone one properly integrated with their likely antiquated and in dire need of updates computer systems.