This sounds like you were on the other end of a fairly common fraud scheme involving money laundering or outright theft. An Ars Technica writer nearly got caught up in the business end (emphasis mine)
The next morning, I checked my email and found the sign-on documents I'd been told to print out, sign, scan and return to the company. When I logged in to Google Hangouts, Mark told me that I'd begin my training period by editing a monograph on cancer treatment protocols using the company style guide. The files arrived, and I had been working for an hour or so when Mark informed me that the check for the equipment would be sent out via email shortly. Once it arrived, I'd need to print it out and then use my electronic deposit service to put it into my account.
When the email with the check arrived it contained two image files. The image of the front of the check was in .jpg format, and the image of the other side was in .png. Upon inspection, the check was issued to me from St. Joseph's High School, which turned out to be a private Catholic girl's school, located in Southern California, a few miles from the biotech firm I was "working" for.
You will suffer no ill effects here. Neither will your bank. Nor the other bank. Most likely there's some poor sot who is now out a LOT of money. From the same article
In her article, Doyle notes that most job fraudsters rely on a tactic commonly known as "Remote Deposit Capture (RDC) Fraud." RDC scams are variations of an old-school confidence scheme that uses a fraudulent check and the victim's unwitting cooperation to access their bank account. The objective is to either draw cash against a fraudulent check, extract money from the victim's account, or both in many cases.
In most cases, the victim deposits the check via electronic means (in your case, it sounds like photo deposit, which is now ubiquitous). The bank gets the check and then credits their account for the full amount before anyone notices.
Unfortunately, the term “clear” sometimes gets used prematurely. An item has cleared only after your bank receives funds from the check writer’s bank. Bank employees might tell you that a check has cleared, and your bank’s computer systems might show that you have those funds available for withdrawal, but that doesn't necessarily mean you can spend the money risk-free.
Then the victim is directed to send the money onto the scammer via fungible and untraceable means (Western Union, gift cards, etc). Then the bank system catches on and pulls the money back, leaving the victim who deposited the check holding the bag.
If a check bounces, the bank will reverse the deposit to your account—even if you've spent some or all of the money from that deposit. If you don't have enough money in your account to cover the reversal, you’ll have a negative account balance and you could start bouncing other payments and racking up fees. Ultimately, you are responsible for deposits you make to your account, and you’re the one at risk.