Because it is a state-run monopoly in most jurisdictions, and in the remaining ones would likely require a legal staff substantially larger than the programming staff.
There are a few start-ups I know of that sell lottery technology/services to states, but afaik it's mostly dominated by big players and hard to break into.