Projective varieties and irreducibility The "modern"(schematic) definition of a projective variety is the following:

Let $k$ be an algebraically closed field. A projective variety over $k$ is a closed subscheme of $\mathbb P^n_k=\textrm{Proj}(k[T_1,\ldots,T_n])$ (Remember the structure of $k$-scheme).

By a well known proposition, every projective variety in the sense of the above definition is of the type
$$\textrm{Proj}\frac{k[T_1,\ldots,T_n]}{I}$$
where $I$ is any homogeneous ideal.

Now, speaking in classical terms, Hartshorne in chapter I of his book defines a projective variety as an irreducible algebraic projective set. This means that with this definition, every projective variety corresponds to a ring of the form:
$$\frac{k[T_1,\ldots,T_n]}{I}$$
but where $I$ is a prime ideal.
Finally my question: Why Hartshorne requires the irreducibility in his definition? Is it strictly necessary?
 A: The choice of whether to require varieties in the scheme-theoretic sense to be (geometrically) irreducible and\or reduced seems to depend on the source. Certainly a $k$-variety ($k$ a field) should be of finite type and separated. The all-mighty Stacks Project also requires integrality (reduced+irreducible), but as Stacks observes, this has the disadvantage that the base change of a variety along a field extension need no longer be a variety (it can fail to be reduced or irreducible). Some sources (e.g. Milne's article in Cornell-Silverman on abelian varieties) require varieties to be geometrically integral. This ensures that base changes along field extensions and products of varieties are again varieties, defining away the problem to which Stacks alludes. I'd say it depends on the application you have in mind whether or not you require your variety to be (geometrically) irreducible. Reducedness I think is less controversial, although I believe Liu does not require his varieties to be reduced. 
In some cases, certain things come automatically. For example, if $X$ is a $k$-scheme that is connected and has a $k$-point, or more generally a point $x$ such that $k$ is separably closed in $k(x)$, then $X$ is geometrically connected. So a connected $k$-group scheme (which has a $k$-point by definition, the identity section) is geometrically connected. If moreover the $k$-scheme is $k$-smooth (hence locally of finite type), then it will necessarily be geometrically integral ($X_{\overline{k}}$ is regular by the smoothness condition and this plus locally Noetherian plus connected implies irreducible). So, for example, in defining an abelian variety over $k$, which is usually defined as a proper smooth connected $k$-group scheme, you have something which is automatically geometrically integral.
Classically, I think varieties were pretty much always required to be irreducible (at least this is the case as you observe in Hartshorne). A variety which is integral has the property that the coordinate ring of any affine open is a domain, which is nice. But again, I don't think there is a conceptual reason when defining varieties over $k$ scheme-theoretically to insist that they be irreducible (and if you do, you might want to insist that they be geometrically so to ensure that products of varieties are varieties, etc.). 
Also, on an unrelated note, when you write "...every projective variety in the sense of the above definition is of the type
$\textrm{Proj}\frac{k[T_1,\ldots,T_n]}{I}$
where $I$ is any homogeneous ideal," the word "any" should be replaced with "some" or "an." The way you have it worded makes it sound like any homogeneous $I$ cuts out the same closed subscheme of projective space.
A: I don't think many people would refer to an arbitrary closed subscheme of projective space as a variety.   It is fairly standard to require varieties to be 
(geometrically) reduced and irreducible.  
One reason is that they then admit a field of rational functions, which records information about the variety up to birational equivalence.  The study of birational geometry of varieties has a long and still-developing history, and since irreducible and connected are the same thing birationally, it makes sense to restrict to the irreducible case, just as in the theory of manifolds, it's not unusual to focus on 
connected manifolds.
Of course, as Martin Brandenburg alludes to in the comments, in constructions frequently non-integral schemes appear, and so no-one would advocate restricting the development of the theory to reduced and irreducible schemes.  People just wouldn't call them varieties.  
One other thing to think about is that a reduced scheme in projective space is determined by its underlying point-set, while a non-reduced scheme is not.  People frequently refer to having a non-reduced structure as having a non-trivial scheme structure, meaning that this is a case where one really has to remember the structure sheaf which gives the scheme its locally ringed structure; unlike in the reduced case, the structure sheaf is not determined by the underlying set of points.
So again, it's not unreasonable to distinguish objects that have a genuinely non-trivial scheme structure from reduced projective schemes.
