A partial answer.
for your specific example, the algebra $B$ generated by the rational intervals, the answer is negative. This algebra is countable and dense in $2^\mathbb{R}$. It is countable and zero-dimensional so it has a countably infinite partition into clopen sets, which in turn yields an unbounded continuous real-valued function on $B$. Now look up Problem 3.12.12 in Engelking's General Topology, or read Engelking, R., and Pełczyński, A.. "Remarks on dyadic spaces." Colloquium Mathematicae 11.1 (1963): 55-63 to see that if $\beta B$ were equal to $2^\mathbb{R}$ the space $B$ would be pseudocompact.
The Boolean algebra $C$ of countable and co-countable subsets of $\mathbb{R}$ is $C^*$-embedded in $2^\mathbb{R}$, and so $2^\mathbb{R}=\beta C$, see I. Glicksberg, Stone-Čech compactifications of products, Trans. Amer. Math. Soc. 90 (1959), 369--382; MR0105667.
So here are two examples, one not injective and one injective. Plus a necessary condition: in order that $\beta B=2^\mathbb{R}$ the subspace $B$ must be pseudocompact.