I could use a 2x3 or 2x4, but am wondering if I could create the larger piece by gluing two or more smaller boards together as that would be cheaper
This is a good and economical way of making up larger sections on a budget. While it may not look as nice as a single piece it'll be at least as strong if you do it right.
It's not absolutely vital but good general practice to carefully select the boards you're glueing together, or, carefully select how they go together.
The ideal would be to use two pieces that are quarter-sawn or close, but it's very rare you'll find pieces with this grain orientation at a big-box store. Since you're very likely to be buying plain-sawn boards alternate the grain (I suggest glueing bark side to bark side) to compensate or any tendency of the boards to cup.
I know glue joints are strong (stronger than the wood they are attaching in many cases), but is it a bad idea to screw into the glue joint like that?
I'm pretty sure that any woodworking book that might mention it will say not to screw directly into a glue joint if you can avoid it. While I take pains to make sure my glue joints are as strong as possible screwing into the joint would be something I would try to avoid doing myself too, although like everyone I've had to do it once or twice. The thing I would take definite steps to avoid would be to align multiple screws along a glue line which is really what you're asking about.
But you're using pocket screws, which by definition go into the wood at a shallow angle, so in reality you're not going to be screwing directly into the glue line. Even if the pilot hole initially lines up with it perfectly it will immediately head off into solid wood so nothing at all to worry about.