Why do the U.S. and other countries have patent systems?

The primary purpose of a patent system in any country is to encourage technical innovations. Patents essentially grant government-blessed monopolies on new technology for limited times, varying between 10 years and 20 years. The expectation is that the monopoly will encourage inventors and their employers to invest in new technology. There is also the expectation that new technology is, in general, good for the general public.