The federal government is not prohibited by the United States Constitution from competing with private industry, and indeed, does so in many instances.
This said, there are a mish-mash of statutes and regulations that limit specific kinds of government competition with private industry, and legislators often decline to compete with private industry as a matter of policy.
For example, there are laws that limit the way that the federal government can use the services of prisoners in federal prisons to compete with private industry. Many states have similar prohibitions which is one of the reasons that many of the stereotypical prison industries, like making license plates, are industries that do not have private sector competition.
There are also laws that prohibit competition with government industries. For example, the Tennessee Valley Authority has a government monopoly on the generation of hydroelectric facilities in its jurisdiction, and the United States Postal Service, in theory, has a monopoly on the delivery of ordinary mail as opposed to express courier services and packages. Similarly, the federal government, in theory, has a monopoly on the issuance of currency not backed by precious metals.
There are some states, Colorado among them, whose state constitutions prohibit competition between state government agencies and the private sector, although these constitutional prohibitions are commonly interpreted in such a way as to not bar state government from participating in industry sectors like education, prisons, and hospitals, where government provision of services has historically had a large market share of the industry.