I know that it's a best practice in a car to change all 4 tires if you change 1, although in practice, it's only done if 3 need to be changed. Does the same thing hold true of a bike?
In a car, the weight distribution is relatively even and you tend to get a relatively even wear, so that if 2 or 3 tires are obviously ready for replacement, you probably just can't tell that the others are ready. I suspect that also having 1 tire with a different amount of tread wear than the other tires on a car will lead to an unbalanced configuration that causes tires to wear out faster. (especially a left-right imbalance)
With a bicycle, the rear tire gets more weight on it than the front and will generally wear out more quickly. By as much as 3:1. Because of this, and other reasons, some people will even use a totally different tire on front than on the back. (could have the narrower tire on the front or on the back, depending on what you want to achieve) On a bicycle, it's perfectly fine if one tire has worn down to being effectively smaller than the other. You will never notice if the bike is "leaning" a millimeter or two forward or back.
The rear also tends to pick up more thorns/nails/screws/glass than the front, so there's also that reason the rear may need to be replaced sooner. The usual theory I've heard is that the front tire knocks the sharp things into a point up configuration in time for the rear tire to catch them, but I strongly suspect that it's more about weight distribution: the tire with more weight has a bigger contact patch and will push down harder on something it rolls over.
Overuse of the rear brake instead of learning to use the front brake properly can cause the rear to wear out even quicker.
You also don't want to rotate your tires between front and back. That's something suggested with some cars, I think because you tend to wear the front differently than the back and can get a longer life that way.
However, if you're using the same type of tires on the front and the back, and it's the rear tire that's being replaced, you probably want to move the front to the back, and put the new tire on the front.
You always want your best tire on the front. A blowout in the rear is scary and inconvenient, but a blowout on the front is very likely to lead to a crash. You also need the traction on the front for stopping much more than you need traction on the rear for acceleration. (and because your weight shifts forward as you stop, you just can't get very much traction on the rear for stopping)
You do not need to have equal tires on both wheels. In fact, great setup for XC racing would be using Schwalbe Rocket Ron on front and Racing Ralph on back. These tires have a bit different tread patterns.
Remember, do not make this mistake - do not put your slightly worn tire on front, just replace the rear tire. It is very important to have grip for the front tire, as it is possible to correct your mistake, if rear tire slips, but slipped front tire mostly means a crash.
I believe it's unnecessary except for rare circumstances (some racers may find it necessary). Front and rear do not wear at the same rate, getting a similar performing (or even the same exact model tire) is easy.
It's become a best practice for cars because by the time you need new tires, they don't make the same model anymore. Mismatched tread patterns and grip levels (different rubber compound or even aged vs. new rubber) can make rain/snow handling a little squirrelly, so it's just safer to replace them all. Also, if you rotate them, they should wear at about the same rate anyways.
However, while it is unnecessary, it could depend in part on where and for what reason you ride your bike. If you rely on your bike as a commuter, you might want to be more certain of the reliability of both tires than if you are riding for fun.
There's more to it than simply whether one tire needs replacing.
Much depends on the tire quality and brand. For lightweight tires, such as Continential Grand Prix, I find I get shorter life from the rear. I keep track of how many miles i have on each tire and pay closer attention when I reach typical life span. Flats and such mean that I rarely change both at the same time. Only exception is before going on a multi-day trip where I want to minimize bike issues