Well, we are on the Riemann sphere and let $p_1$ and $p_2$ be $0$ and $\infty$. I want to compute a basis and dimension for the complex vector space $$L^{(1)}(D) = \left\{ \omega \ : \ {\rm div }(\omega) \geq D \right\} $$ ($D = -p_1 -2p_2$ and $\omega$ is a meromorphic 1-form.)
Now my attempt is :
For the dimension I can use Riemann Roch formula that says $${\rm dim \ } L(D) - {\rm dim \ }L^{(1)}(D) = {\rm deg \ }D +1.$$ where $$ L(D) = \left\{ f \ : \ {\rm div}(f) \geq -D \right\}$$ with $f$ denoting a meromorphic function.
So, from the fact that $D$ is of negative degree and we are in a compact Riemann surface we have that $L(D) = \{ 0 \}$, so the dimension of this space is $0$. In addition the divisor has degree $-3$. Substituting in the formula we find that the dimension of $L^{(1)}(D)$ is $2$.
I also observed that $-2p_2 $ is linearly equivalent to the canonical divisor $K$ because the surface has genus $0$.
Then, I can rewrite the initial space as $L^{(1)}(-p_1 + K)$ which is isomorphic to $L(K -( -p_1 + K)) = L(p_1)$. Is there something wrong in my attempt? What is the basis of this space?
Everything you said is correct.
As you pointed out, $L^{(1)}(-p_1 - 2p_2) \cong L(K + p_1 + 2p_2)$ is the space of meromorphic one-forms with at most a single pole at $p_1$ and at most a double pole at $p_2$.
Using $z$ as the coordinate on $\mathbb {CP}^1$, with $p_1$ as $z = 0$ and $p_2$ as $z = \infty$, a basis for $L(K + p_1 + 2p_2)$ is given by: $$ dz, \ \ \ \ z^{-1} dz.$$
Clearly, these meromorphic one-forms have no more than a single pole at $z = 0$. To inspect their behaviour at $z = 0$, we define a new coordinate, $w = 1/z$. Rewriting in terms of the $w$ coordinate, the meromorphic one-forms look like: $$ w^{-2} dw, \ \ \ \ w^{-1} dw,$$ which clearly have no more than a double pole at $w = 0$.