The question assumes that the toothpaste was bottled and squeezed the same way it appears when it comes out. This is a misconception. (Please read Edit
The two/three components of the toothpaste are stored in different parts of the tube. The white layer constituting the majority fills from the base and the stripe constituent fills near the top of the tube. Remember, these are high viscous fluids. They don't mix easily.
Now, how do they appear so uniformly in the paste?
When you apply the pressure on the tube, the majority white constituent is pushed through the bigger tube, and some of the pressure is forwarded to the region where the striped constituent is stored. There is a small opening/nozzle between the bigger tube and this region, as you can see in the image I picked up from the internet. Now, companies easily modify the design of the nozzle to get different styles of stripes.
Physics is awesome, right?Edit
- As Colin
has pointed out in his answer, it appears that this is not the only way striped toothpastes are prepared. There are toothpastes which come already bottled in form of stripes.