You have to seperate these two things and train them apart.
Then think if there is may be something you do that makes the horse go crooked. Is your weight evenly devided in your stirrups, do you relax when your horse is standing still, are your reins the same lenght, etc.
First train your horse to stand still. You can also begin to train this from the ground and put a command on it.
-If you start from the ground: stand still yourself. Be relaxed, exhale and keep your shoulders soft. If you work from the saddle: be relaxed and sit still in the saddle, exhale and keep your shoulderjoints soft and all your other joints too but keep your back stright (not overstreched).
-reward the slightest try of your horse. If he is slowing down, relax your reins. If he is still walking give the soft aid again.
- try first a few seconds (counting out loud will help)
-some people recommand putting your horse back where you where if he starts to walk, but sometimes this is confusing for the horse (since you start giving all kinds of riding aids and your purpose is standing still and give 'no' aids)
Once your horse know what 'halt' means you can start working on standing still straight. You can also start training this from the ground and tap softly (!) the leg that has to come under. Reward only when the horse stands straight (a treat works really motivating for the most horses). A helper can come in handy in the beginning.
If your horse has difficulties standing straight it can also be a sign that your horse is crooked. A straight horse has no (physical) problems to stand straight.