Consider an even simpler example: the circle $C := \{(x,y) \in \mathbb{A}^2 : x^2 + y^2 = 1\}$, seen as an algebraic variety over the reals, is affine. But in fact, the morphism $C \to \mathbb{P}^1$ taking $(x,y)$ to $\frac{y}{x+1}$, with inverse $t \mapsto (\frac{1-t^2}{1+t^2}, \frac{2t}{1+t^2})$, defines an isomorphism of $C$ with the complement of the zero-dimensional closed subvariety $\{t^2+1=0\}$ of $\mathbb{P}^1$, and this extends to an isomorphism between the projective closure $\bar C := \{(X:Y:Z) \in \mathbb{P}^2 : X^2 + Y^2 = Z^2\}$ and $\mathbb{P}^1$. The thing is, $C$ and $\bar C \cong \mathbb{P}^1$ have the same real points, even though $C$ is an open subset of $\bar C$. (But it is $C$ which is an algebraic group, through $(x,y) * (x',y') = (xx'-yy', xy'+yx')$, namely $\mathit{SO}_2$, not $\bar C$.)
I'm not sure what to say apart from, “well, the real points simply don't determine the algebraic variety” (of course, the algebraic variety can even have an empty set of real points, as $\{X^2 + Y^2 + Z^2 = 0\} \subseteq \mathbb{P}^2$, so this is no surprise).
There are various ways to turn an affine variety into a projective one or vice versa. If $X \subseteq \mathbb{A}^m$, you can always consider its projective closure $\bar X \subseteq \mathbb{P}^m$ (defined by homogeneizing the equations of $X$), but that's not nicely functorial (it depends on the given embedding $X \subseteq \mathbb{A}^m$, not just on $X$ as an algebraic variety), and it might behave unpleasantly at infinity; conversely, given $X \subseteq \mathbb{P}^m$, you can always simple-mindedly consider its intersection with $\mathbb{A}^m$.
There are also some more functorial ways, but they are generally not too interesting in a given situation: given any scheme $X$ you can associate an affine scheme $\mathop{\mathrm{Spec}}(\Gamma(X,\mathcal{O}_X))$ as Isac Hedén points out in his answer, and this is functorial and universal (this construction is the left adjoint of the inclusion functor of the category of affine schemes in the category of schemes), but if $X$ is projective, this is going to be disappointing (essentially, you will get the zero-dimensional scheme of geometrical connected components of $X$). Similarly, given a scheme $X$ and an invertible sheaf $\mathscr{L}$ on $X$, you can form $\mathop{\mathrm{Proj}}(\bigoplus_{\ell\in\mathbb{N}}\Gamma(X,\mathscr{L}^{\otimes\ell}))$, but it tends to be equally boring.
In the context of real algebraic groups, what really saves the day is some form of Weyl's "unitarian trick": complex connected semisimple linear algebraic groups are equivalent to compact connected semisimple real Lie groups, and, as you point out, the quotients of the former by their parabolic subgroups can be seen as quotients of the latter. But this is particular to this situation and not a reflection of a general phenomenon (as far as I know).