At X's expense and of X's timber
Re-read the sentence. The of refers to the gaols, not the prisoner. It means that the jails (gaols) are to be built of the King's timber (wood).
Re-read the sentence. The of refers to the gaols, not the prisoner. It means that the jails (gaols) are to be built of the King's timber (wood).