I pulled off a light switch and was going to replace it, but the wiring seems non-standard. The switch is evidently a three way, but has no ground. It has a brass common screw and two traveler screws. See the picture in the box...the black wires are not even being used?!
The metal box appears to be grounded, so the switch can acquire ground via the mounting screws. (this doesn't work for receptacles).
Here is the crux of how a 3-way circuit works.
Note that your light is probably shifted to the left, i.e. in between the power supply and the first switch.
3-way switches have 2 travelers (on brass screws) and 1 common wire (on black screw). 3-way cables contain 2 travelers and 1 other wire; the function and color of the other wire varies and can be anything.
When it comes to 3-way circuits, identify the travelers (the ones on the brass screws; also in the same cable) and wrap them (both) with yellow tape to re-mark them. This will save you a great deal of time and trouble.
The two yellow-marked travelers will be on the brass screws.
As to why the white is being used as a hot, this appears to be a "switch loop" which is 3-way. The /2 cable carries always-hot (on the white by law) and the switched hot. The /3 cable carries 2 travelers and the switched hot.
I hope you took pics of the original the black or brass screw would have been the common and the silver screws the travelers. You may have to figure it out trial and error. But hooking up a 3 way wrong won’t hurt it will work with the correct connections but some combinations won’t work then you have to change them around until it works. If you have a meter we can help with more specifics.