Can they do this?
In most of the world yes, this is why they hire contractors. Contractors are called in for temp work, in a pinch they are usually the first to be let go, and when cost savings is in effect you'll get the short end of the stick.
Actual employees have way more rights and restrictions about what employers can and cannot do than contractors. They get PTO, protection from wrongful termination, mandatory notice periods, etc. (the specifics and effectiveness of these perks vary greatly depending on where you live)
Contractors on the other hand have very little in the way of legal rights and protection in regards to employment. Essentially if it's not explicitly mentioned in your contract (Or against the law) they can do it. In many places in the world a company CAN force you to take a vacation, it's up to you if you burn PTO on it. (Since most contractors don't get PTO you get shafted here)
What can you do?
You can ask your agency for something to do to float the lapse, or even request a transfer to work for someone else. You could also ask the client if there is anything you can do to work through the lapse.
What should you expect?
From the client, probably not much. You're a contractor, as far as most companies are concerned you're disposable labor. You enjoy the freedoms of being able to shift from place to place and not stress over being stuck working in anyplace too long, at the same time it costs you job security.
The agency is probably a 50/50, if they have a small project that needs doing they could throw it your way, but if they don't they aren't going to pay you to stand around. On the other hand if you're not happy with the treatment from the current client they might be willing to bump you to someone else, really depends on what they need right now.
TLDR
As a contractor you have very little in the way of rights and are considered "disposable" by most companies standards. This sort of behavior is legal in most places and annoying, but not unheard of. Your only likely choice are grin accept it, or find someone else to work for.