$\def\Rbf{\mathbf{R}}$ By the Heine-Borel theorem, the real line $\mathbf{R}=(-\infty,+\infty)$ with the standard topology is not compact.
By the Alexandroff extension, one has the one-point compactification $\Rbf\cup\{\infty\}$, which is homeomorphic to the circle $S^1$. On the other hand, the extended real line $[-\infty,\infty]$ with the order topology is compact; it is homeomorphic to the closed interval $[0,1]$.
When introducing the (abstract) Lebesgue integration theory, Rudin in his Real and Complex Analysis uses the extended real line instead of $\Rbf\cup\{\infty\}$ for the range of measurable functions.
Is it just a matter of convention or are there any deep reasons that one should use one not the other?
Yes, it makes a big difference. The key is ordering.
Lebesgue integration theory relies critically on having a good ordering on the range space of your functions, and on the space where the integral takes its values. This can be seen in the very definition of the Lebesgue integral $\int f$ as the supremum of $\int g$ over all simple functions $g$ with $g \le f$. The word "supremum" involves the ordering on the space where the integral takes its values, and the condition $g \le f$ involves the ordering on the range space. You see it again in fundamental results like the monotone convergence theorem, Fatou's lemma, etc.
Now the ordering on $\mathbb{R}$ itself is pretty nice, what with the least upper bound property, but the extended reals are even nicer: in $[-\infty, \infty]$, every set has a least upper bound, every nondecreasing sequence converges, and so on. This means we can avoid a lot of special cases when talking about functions with singularities or whose integrals are infinite. The tradeoff is the algebra is less nice: $[-\infty, \infty]$ is no longer a field, and so we have to add some special cases for expressions like $0 \cdot \infty$ or $\infty + -\infty$. But that's manageable.
By contrast, $\mathbb{R}$ together with an "unsigned infinity" would be totally unsuitable, as it has no good ordering at all: you don't want to say either $0 < \infty$ or $0 > \infty$, so the trichotomy axiom fails. Then you have a problem with the definition of the integral: if you have a function $f$ that takes the value $\infty$ somewhere, you can't decide whether the simple function $g=0$ should be included in the supremum defining $\int f$.