Why, when deriving the Einstein equations, do we want the energy-momentum tensor to be divergence free? So when deriving the Einstein equation we assume $\nabla_\mu T^{\mu\nu}=0$.  Now I get this is not true energy conservation but why do we assume this, it seems vital for the einstein tensor to have the form it does? Or is there another way to get the Einstein tensor which doesn't require it to be divergence free (and the divergence free-ness is sort of a coincidence)?
 A: 
So when deriving the Einstein equation we assume 
   $\nabla_\mu T^{\mu\nu}=0$.
   Now I get this is not true energy conservation,
   but why do we assume this?

Actually it is energy and momentum conservation together.
To see this consider the meaning of the $T^{\mu\nu}$ components,
with $m$ and $n$ being spatial indexes ($1,2,3$).
(See also Stress-energy tensor - Identifying the components of the tensor)


*

*$T^{00}$ is energy density.

*$T^{m0}$ is energy flux density.

*$T^{0n}$ is momentum density

*$T^{mn}$ is momentum flux density.


Therefore the divergence free-ness $\nabla_\mu T^{\mu\nu}=0$
has the following parts:


*

*For $\nu=0$:
$$\nabla_0 T^{00}+\nabla_m T^{m0}=0$$
This is energy conservation, written as a continuity equation.

*For $\nu=1,2,3$:
$$\nabla_0 T^{0n}+\nabla_m T^{mn}=0$$
This is momentum conservation, written as a continuity equation. 

A: It is not necessary to assume that  $\nabla_\mu T^{\mu\nu}=0$, for deriving the Einstein equation. The best argument for the form of the Einstein equation is usually considered to be Lovelock's theorem. This theorem states the form of the Einstein equation follows from the assumption that it follows from an action principle, provided that the gravitational action satisfies:


*

*It depends only on the metric (and its derivatives.)

*It is at most second order in derivatives of the metric.

*It is local.

*Spacetime is four-dimensional.


That the Einstein tensor is divergence free, then follows as a consequence and is not an a priori assumption.
A: Well, this is energy conservation essentially and a bit more. It also states that momentum is conserved along axis. 
I believe, that the answer to this comes from the classical field theory. If you consider a Lagrangian that is translationally invariant $\mathcal{L}(x^\mu)$. By performing a transformation $x^{\mu} \rightarrow x^\mu + \epsilon^\mu$ and by applying Noether's theorem you get that the conserved current is of the following form:
$j^\mu = \epsilon^{\lambda} T^{\mu}_{\lambda}$
But this really gives you four conserved currents, because you have 4 independent choices for $\epsilon^{\lambda}$ (for example $(1,0,0,0)$). Since the current is conserved, we have:
$\partial_{\mu} j^{\mu}=0$
Which is equivalent to your divergence-free condition. 
Now, in General Relativity this is true only locally where the space is Minkowski. But, you can always get away with replacing partial with a covariant derivative. 
I am not sure if there are theories in which it is sensible not to have divergence free stress tensor. However, a useful thing to remember is that you can always modify your stress-energy tensor by adding $\partial_\lambda K^{\lambda\mu}_{\rho}$ where $K^{\lambda\mu}_{\rho}$ is anti-symmetric in $\lambda$ and $\mu$ which guarantees that the new stress energy tensor is divergence free. 
A: Within a normal neighbourhood, we have that the metric tensor can locally be expressed by the flat metric, and the Christoffel symbols vanish. More specifically, within a distance $x$ from the point $p$, we have 
\begin{eqnarray}
g &=& \eta + \mathcal{O}(x^2)\\
\Gamma &=& \mathcal{O}(x)
\end{eqnarray}
So in that neighbourhood, we have
\begin{eqnarray}
\nabla_\mu T ^{\mu\nu} = \partial_\mu T^{\mu\nu} + \mathcal{O}(x)
\end{eqnarray}
If the divergence is zero, then imagine the measured four-momentum as measured by an observer $u$, $p^\mu = T^{\mu\nu} u_\nu$ : 
\begin{eqnarray}
\nabla_\mu (T ^{\mu\nu} u_\nu) &=& T ^{\mu\nu} \nabla_\mu u_\nu + u_\nu \nabla_\mu T ^{\mu\nu} \\
&=& T ^{\mu\nu} u_\mu a_\nu + u_\nu \nabla_\mu T ^{\mu\nu}
\end{eqnarray}
Therefore, if we assume an acceleration of zero (so that we're dealing with an inertial observer), we have
\begin{eqnarray}
\partial_\mu (p^\mu) &=& \mathcal{O}(x)
\end{eqnarray}
This means that locally, the four-momentum is a conserved current, with a deviation from conservation roughly equivalent to the curvature of spacetime times the distance (for any local experiment this is extremely small). So far, any experiment we have conducted has shown local energy conservation. 
A non-zero divergence on a scale larger than the curvature of spacetime would imply differences with experiments. A very small divergence is still possible, and indeed part of some theories, but so far none of these have been measured.
A: OP is right that the equation $\nabla_\mu T^{\mu\nu}=0$ doesn't by itself signify a conservation law (a Killing symmetry of the metric is also needed). Rather the equation $\nabla_\mu T^{\mu\nu}=0$ is a consequence of diffeomorphism symmetry of the matter theory. For details, see e.g. my Phys.SE answer here. 
