Oklahoma has a panhandle because of the Missouri Compromise.
The Oklahoma Panhandle is an unusual boundary that exists due to a law passed 87 years before Oklahoma even became a state: the Missouri Compromise of 1820. The law admitted Missouri to the union as a slave state and Maine as a free state to maintain the existing balance, and prohibited slavery above the 36 degrees 30 minutes north parallel in the rest of the Louisiana Purchase. The panhandle was formed after the Republic of Texas was admitted to the union in 1845 as a slave state south of this line, but with a little sliver of land jutting above the boundary. Rather than separate Texas into two portions, Congress passed the Compromise of 1850, in which Texas ceded the land. The region became known as the Public Land Strip, or colloquially as “No Man’s Land.”
From 1850 to 1890, this narrow, rectangular tract of land, roughly 167 miles long and 35 miles wide, existed as a separate entity from any state or territorial government, making it an attractive destination for homesteaders and outlaws. The land was bordered by Texas to the south, the New Mexico Territory to the west, and unorganized territories to the north and east. The Organic Act of 1890 finally brought an end to this unusual situation, as the Public Land Strip was assigned to the new Oklahoma Territory. The panhandle remained a part of Oklahoma when it became the 46th U.S. state on November 16, 1907, giving the Sooner State its unique shape.