It's illegal but not very unusual or weird (in the UK, at least). Well, using a work visa to do it is a little unusual. Normally (if that's the right word), a foreign national pays a UK citizen a large sum of money to get married so that the foreign national can get a "spouse" visa. It's called a "marriage of convenience".