The kind of completely regular space you are looking for is an $F$-space.
Suppose that $X$ is a completely regular space. Then we say that a subset $A\subseteq X$ is $C^*$-embedded if whenever $f:A\rightarrow\mathbb{R}$ is bounded and continuous, there is a continuous $g:X\rightarrow\mathbb{R}$ with $g|_A=f$. We say that a subset of $X$ of the form $f^{-1}[\{0\}]^c$ for some continuous $f:X\rightarrow\mathbb{R}$ is a cozero set. An $F$-space is a space where every cozero set is $C^*$-embedded.
Proposition: Let $X$ be a completely regular space. Then the following are equivalent:
$X$ is an $F$-space
whenever $f,g:X\rightarrow\mathbb{R}$ are continuous with $0\leq f\leq g$ there is some continuous $h:X\rightarrow\mathbb{R}$ with $f=gh$.
whenever $f,g:X\rightarrow\mathbb{R}$ are bounded and continuous with $0\leq f\leq g$ there is some continuous $h:X\rightarrow\mathbb{R}$ with $f=gh$.
Proof: $2\rightarrow 3$ follows since in (3) we strengthen the premises.
$1\rightarrow 2$ Suppose that $X$ is an $F$-space, and $0\leq f\leq g$. Then let $\ell:g^{-1}[\{0\}]^c\rightarrow\mathbb{R}$ be the function defined by letting $\ell(x)=f(x)/g(x)$. Then $g^{-1}[\{0\}]^c$ is a cozero set, and $\ell$ is bounded, so $\ell$ extends to a bounded continuous function $h:X\rightarrow\mathbb{R}$. Observe that $f=gh$.
$3\rightarrow 1$. Let $U$ be a cozero set, and let $\ell:U\rightarrow[0,1]$ be a continuous function. Let $g:X\rightarrow[0,1]$ be a continuous function where $U=g^{-1}[\{0\}]$$U=g^{-1}[\{0\}]^c$. Then let $f:X\rightarrow[0,1]$ be the continuous function such that $f(x)=g(x)\ell(x)$ whenever $x\in U$ and $f(x)=0$ elsewhere. We observe that $0\leq f\leq g\leq 1$, so there must be a continuous function $h:X\rightarrow[0,1]$ with $f=gh$. However, this means that $h(x)=\ell(x)$ whenever $x\in U$, so $h$ is a continuous extension of the function $\ell$.
Q.E.D.
There are plenty of other characterizations of the $F$-spaces. If $X$ is a completely regular space, then let $C(X)$ denote the ring of all continuous functions $f:X\rightarrow\mathbb{R}$. If $A,B\subseteq X$, then we say that $A,B$ are completely separated if there is a continuous function $f:X\rightarrow[0,1]$ with $A\subseteq f^{-1}[\{0\}],B\subseteq f^{-1}[\{1\}]$.
The following fact can be found in the standard text Rings of Continuous Functions by Gillman and Jerison.
Let X be a completely regular space. The following are equivalent:
$X$ is an $F$-space.
The Stone-Cech compactification $\beta X$ is an $F$-space.
Every finitely generated ideal in $C(X)$ is principal.
Every ideal in $C(X)$ is convex.
For all $f\in C(X)$, there is a $g\in C(X)$ with $f=g\cdot |f|$.
If $f\in C(X)$, then the sets $\{x\in X\mid f(x)>0\}$ and $\{x\in X\mid f(x)<0\}$ are completely separated.
If $M\subseteq C(X)$ is a maximal ideal, then the set of all prime ideals $P$ in $C(X)$ with $P\subseteq M$ is linearly ordered.
If $f,g\in C(X),$ then $\langle f,g\rangle=\langle|f|+|g|\rangle.$
Comparison with other properties
If $X$ is an $F$-space, then every countable subset of $X$ is $C^*$-embedded. Therefore, every compact $F$-space has a homeomorphic copy of $\beta\omega$. A basically disconnected space is a completely regular space where every cozero set has open closure. Every basically disconnected space is an $F$-space, but $(\beta\omega)\setminus\omega$ is an $F$-space that is not basically disconnected. There are also some connected $F$-spaces.