Formalizing an approach to the sum $\sum_{k=0}^{\infty}ka^k$ 
Let a be $a$ be a real number such that $0<a<1$
  find
  $\begin{align}
\sum_{k=0}^{\infty}ka^k
\end{align}$

I know that
$a^0+a^1+...+a^\infty = \frac{1}{1-a}$
By stretching it as follows
$\begin{align}
\sum_{k=0}^{\infty}ka^k= \\a^1+a^2+a^3...+a^\infty \\+a^2+a^3+a^4...+a^\infty
 \\+a^3+a^4+a^5...+a^\infty
\\ .\\.\\.\\+a^\infty \\= \sum_{k=1}^{\infty}\frac{a^k}{1-a}
\\ = \frac{a}{(1-a)^2}\end{align}$
Writing it a little better, 
$\begin{align}
\sum_{k=0}^{\infty}ka^k=
\end{align}$
$\begin{gather}
a^1\rightarrow a^\infty+\\a^2\rightarrow a^\infty+\\ \downarrow \\a^\infty \end{gather}\\$$\begin{align}=\sum_{k=1}^\infty\frac{a^k}{1-a}= \frac{a}{(1-a)^2}\end{align}$
How to formalize this stuff?

First of all, there is no last term, $a^{\infty}$. The proper way to write these sums would be $a_1+a_2+\cdots$.

Your argument is basically this: we have an infinite triangle of numbers that looks like
$$
\begin{array}{ccccc}
a^1 & a^2 & a^3 & \dots\\
 & a^2 & a^3 & \dots\\
 &  & a^3 & \dots\\
 &  &  & \ddots\\
\end{array}
$$
The given sum, $\sum ka^k$, is what happens when you add up all the columns, then add up all of those sums. What you have done is instead first add up the rows, then add up all of those sums. The fact that both summation methods agree is obvious for a finite array of numbers, but requires justification for infinite ones. It turns out that is always OK to do when all the terms are nonnegative, which they are in your case. This is known as Tonelli's theorem.

Here is another method, which is different and less intuitive than your method, but is easier to justify. By definition, $\sum_{k=1}^\infty ka^k=\lim_{n\to\infty} \sum_{k=1}^n ka^k$. We can compute all of these finite sums exactly using your trick:
$$
\begin{align}
\sum_{k=1}^n ka^k
&=(a^1+\dots+a^n)+(a^2+\dots+a^n)+\dots+(a^n)\\
&=\frac{a^1-a^{n+1}}{1-a}+\frac{a^2-a^{n+1}}{1-a}+\dots+\frac{a^n-a^{n+1}}{1-a}\\
&=\frac{a+\dots+a^n-na^{n+1}}{1-a}\\
&=\frac{\frac{a-a^{n+1}}{1-a}-na^{n+1}}{1-a}\end{align}$$ 
Letting $n\to\infty$, the $a^{n+1}$ and $ na^{n+1}$ both disappear, leaving the answer you expected.
