supercat and BowlOfRed's answers are right on the track, but I feel like there are some missing info that I can add.

Note: Since OP mentions "On almost all keyboard layouts I have ever seen", I assume OP is talking about QWERTY layout, which "is the most common modern-day keyboard layout for Latin script."

Let's take a look at the history of keyboard layout:

History Keyboard layouts have evolved over time, usually alongside major technology changes. Particularly influential have been: the Sholes and Glidden typewriter [...] which introduced QWERTY; its successor, the Remington No. 2 (1878), which introduced the shift key ; the IBM Selectric (1961), a very influential electric typewriter, which was imitated by computer keyboards; and the IBM PC (1981), namely the Model M (1985), which is the basis for many modern keyboard layouts.

(Emphasis mine)

Basically, we can safely say that most computer keyboards that we're using now is based on Sholes and Glidden typewriter with its QWERTY layout. So, we have to take a look at a particular characteristic of it: The Sholes and Glidden could print only upper-case letters.

(Image courtesy of http://site.xavier.edu/polt/typewriters/sholesandglidden.html)

As it has been mentioned on previous answers, 1 and 0 didn't exist before the final iteration of QWERTY, since "1" and "0" are identical to "I" and "O".

The third iteration of QWERTY has layout like this:

2 3 4 5 6 7 8 9 - , Q W E . T Y I U O P Z S D F G H J K L M A X & C V B N ? ; R

(Image courtesy of Wikimedia Commons)

The final iteration of QWERTY (as we've been using) has layout like this:

1 2 3 4 5 6 7 8 9 0 - = Q W E R T Y U I O P [ ] \ A S D F G H J K L ; ' Z X C V B N M , . /

But before that, some keyboards still omitted 1 , just like BowlOfRed mentioned, "The 0 key was added and standardized in its modern position early in the history of the typewriter, but the 1 and exclamation point were left off some typewriter keyboards into the 1970s", and it was placed after 9 because it looks better logically than having 0 before 2 . And thus, 1 was placed before 2 , the only place left without changing the overall layout.

(Image courtesy of BedahTekno (in Bahasa Indonesia))