In the episode with Lewis and Clark when they attack the Govenors Mansion and are captured the govenor says to them "you are not in Kansas anymore". Earlier we see a newspaper that shows the date as 1801. Kansas was not a state until 1861
Kansas may not have been a state yet, but I would be willing to bet it was a settled, named territory well before then. I'm not sure if the Kansas territory was around quite that early, but it's possible that Kansas was already a defined place, if not a state. Could be allowable.
Whoop de do, even if Kansas wasn't a state it wouldn't matter. You're telling me that everything else that's in that dumb show existed in the early 19th century? I don't think there were any electrically-powered submarines with satellite tv or what the hell ever.
The line "We're not in Kansas anymore" is from The Wizard of Oz, which was released in 1939 (per the IMDB). The show is obviously set before then.
Poor writing? Or do they simply not care about accuracy and want it to be funny?
Ummm, as Sam Raimi and Bruce Campbell have noted, they could care less about strict historical accuracy. As you might have noticed from watching Army of Darkness, Hercules, Xena, etc.